Fix issues detected by static analysis tool
[platform/upstream/libxkbcommon.git] / fuzz / fuzz.sh
1 #!/bin/sh
2 set -e
3
4 case "$1" in
5     keymap|compose)
6         ;;
7     *)
8         echo "usage: $0 keymap|compose" 1>&2
9         exit 1
10         ;;
11 esac
12
13 export CC=afl-clang-fast
14 export AFL_HARDEN=1
15 test -d fuzz/build || meson setup -Db_lto=true fuzz/build
16 meson compile -C fuzz/build
17 afl-fuzz -i fuzz/$1/testcases -x fuzz/$1/dict -o fuzz/$1/findings -t 200 -m 10 -- ./fuzz/build/fuzz-$1 @@