[compiler-rt] r323802 - [libFuzzer] Fix sizeof(ptr) bug.
Matt Morehouse via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 10:25:55 PST 2018
Author: morehouse
Date: Tue Jan 30 10:25:55 2018
New Revision: 323802
URL: http://llvm.org/viewvc/llvm-project?rev=323802&view=rev
Log:
[libFuzzer] Fix sizeof(ptr) bug.
sizeof(const char *) returns 4 or 8 when what we really want is the size
of the array.
Modified:
compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp
Modified: compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp?rev=323802&r1=323801&r2=323802&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp (original)
+++ compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp Tue Jan 30 10:25:55 2018
@@ -62,7 +62,7 @@ MutationDispatcher::MutationDispatcher(R
static char RandCh(Random &Rand) {
if (Rand.RandBool()) return Rand(256);
- const char *Special = "!*'();:@&=+$,/?%#[]012Az-`~.\xff\x00";
+ const char Special[] = "!*'();:@&=+$,/?%#[]012Az-`~.\xff\x00";
return Special[Rand(sizeof(Special) - 1)];
}
More information about the llvm-commits
mailing list