<div dir="ltr">Is there any easy to construct test case that was missing here? (that enabled this bug to go undiscovered until now)</div><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 30, 2018 at 10:27 AM Matt Morehouse via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: morehouse<br>
Date: Tue Jan 30 10:25:55 2018<br>
New Revision: 323802<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=323802&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=323802&view=rev</a><br>
Log:<br>
[libFuzzer] Fix sizeof(ptr) bug.<br>
<br>
sizeof(const char *) returns 4 or 8 when what we really want is the size<br>
of the array.<br>
<br>
Modified:<br>
    compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp<br>
<br>
Modified: compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp?rev=323802&r1=323801&r2=323802&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp?rev=323802&r1=323801&r2=323802&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp (original)<br>
+++ compiler-rt/trunk/lib/fuzzer/FuzzerMutate.cpp Tue Jan 30 10:25:55 2018<br>
@@ -62,7 +62,7 @@ MutationDispatcher::MutationDispatcher(R<br>
<br>
 static char RandCh(Random &Rand) {<br>
   if (Rand.RandBool()) return Rand(256);<br>
-  const char *Special = "!*'();:@&=+$,/?%#[]012Az-`~.\xff\x00";<br>
+  const char Special[] = "!*'();:@&=+$,/?%#[]012Az-`~.\xff\x00";<br>
   return Special[Rand(sizeof(Special) - 1)];<br>
 }<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>