From 98f9e64d332654a9c67bc6057edb3b6aee0c9cdb Mon Sep 17 00:00:00 2001 From: Evgeny Vereshchagin Date: Fri, 26 Mar 2021 05:40:36 +0000 Subject: [PATCH] fuzz: generate all the config keys and add them to the seed corpus It should help to cover more code faster Signed-off-by: Evgeny Vereshchagin --- src/tests/oss-fuzz.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/oss-fuzz.sh b/src/tests/oss-fuzz.sh index 1a50049be..6f16a6fc1 100755 --- a/src/tests/oss-fuzz.sh +++ b/src/tests/oss-fuzz.sh @@ -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 -- 2.47.2