[llvm] r283021 - [libFuzzer] fix a recent bugs (buffer overflow)
Kostya Serebryany via llvm-commits
llvm-commits at lists.llvm.org
Sat Oct 1 00:13:25 PDT 2016
Author: kcc
Date: Sat Oct 1 02:13:25 2016
New Revision: 283021
URL: http://llvm.org/viewvc/llvm-project?rev=283021&view=rev
Log:
[libFuzzer] fix a recent bugs (buffer overflow)
Modified:
llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
Modified: llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp?rev=283021&r1=283020&r2=283021&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp Sat Oct 1 02:13:25 2016
@@ -92,7 +92,7 @@ bool TracePC::FinalizeTrace(size_t Input
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;
More information about the llvm-commits
mailing list