chiark / gitweb /
regress: fuzzraw: Provide a dictionary suitable for AFL
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 9 Dec 2016 21:12:18 +0000 (21:12 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
regress/Makefile.in

index 4abc113..993c1af 100644 (file)
@@ -68,7 +68,11 @@ fuzzcat.d:   checkfuzz
                perl -ne 'print $$1,"\n" while m/\"([^"% ]{2,})\"/g' \
                        $(srcdir)/../src/*.[ch] $(srcdir)/../client/*.[ch] \
                | sort -u >fuzzcat.d/dictionary
-
+               perl -p -e 'chomp;' \
+                       -e 's/[^0-9a-z-_]/sprintf "\\x%02x", ord $$&/ige;' \
+                       -e 's/^/l$$.="/; ' \
+                       -e 's/$$/"\n/;' \
+                       fuzzcat.d/dictionary >fuzzcat.d/dictionary.afl
 
 check-%:       case-%.sys
                @srcdir=$(srcdir) $(srcdir)/r1test $* || test $$? = 5