bsdiff
bsdiff copied to clipboard
bsdiffpatch-test.c: New file suitable for AFL fuzzing
TL;DR: Fuzzing passed.
See http://lcamtuf.coredump.cx/afl/
The basic idea is we take an arbitary input file, split it in half. The first half is the original, the second is the modified. Then do a roundtrip diff->patch and verify that it worked.
I ran this for 1.5 days on one core, and didn't find any crashes, and the hangs appeared to be false positives.
Usage:
$ afl-fuzz -i input -o findings -- ./bsdiffpatch-test
The input directory contained a two byte file with NULs - afl
rapidly found other inputs.
This code should hopefully be useful if we ever decide to change the code in the future, or for anyone who wants to try variants of fuzzing now.
(A variant of this would be to fuzz test patches only, but I'm not as interested in that - we only apply patches which have known integrity, i.e. covered by a GPG signature or TLS)