]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
fuzz: generate all the config keys and add them to the seed corpus 3737/head
authorEvgeny Vereshchagin <evvers@ya.ru>
Fri, 26 Mar 2021 05:40:36 +0000 (05:40 +0000)
committerEvgeny Vereshchagin <evvers@ya.ru>
Fri, 26 Mar 2021 05:49:19 +0000 (05:49 +0000)
It should help to cover more code faster

Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
src/tests/oss-fuzz.sh

index 1a50049be8cb89998a5667124d509603c6cc069d..6f16a6fc1df661e7c7659cb56aa911aff7e1794e 100755 (executable)
@@ -43,4 +43,6 @@ make -j$(nproc)
 $CC -c -o fuzz-lxc-config-read.o $CFLAGS -Isrc -Isrc/lxc src/tests/fuzz-lxc-config-read.c
 $CXX $CXXFLAGS $LIB_FUZZING_ENGINE fuzz-lxc-config-read.o src/lxc/.libs/liblxc.a -o $OUT/fuzz-lxc-config-read
 
+perl -lne 'if (/config_jump_table\[\]\s*=/../^}/) { /"([^"]+)"/ && print "$1=" }' src/lxc/confile.c >doc/examples/all-keys.conf
+[[ -s doc/examples/all-keys.conf ]]
 zip -r $OUT/fuzz-lxc-config-read_seed_corpus.zip doc/examples