1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

[libFuzzer] fix a recent bugs (buffer overflow)

llvm-svn: 283021
This commit is contained in:
Kostya Serebryany 2016-10-01 07:13:25 +00:00
parent 6d5567d561
commit 827a5cb086

View File

@ -92,7 +92,7 @@ bool TracePC::FinalizeTrace(size_t InputSize) {
else if (Counter >= 2) Bit = 1;
size_t Feature = i * 8 + Bit;
CounterMap.AddValue(Feature);
uint32_t *SizePtr = &InputSizesPerFeature[Feature];
uint32_t *SizePtr = &InputSizesPerFeature[Feature % kFeatureSetSize];
if (!*SizePtr || *SizePtr > InputSize) {
*SizePtr = InputSize;
Res = true;