| 1 |
libFuzzer instructions for libxslt |
| 2 |
================================== |
| 3 |
|
| 4 |
Set compiler and options. Disable float-divide-by-zero and pointer-overflow |
| 5 |
sanitizers when using UBSan. |
| 6 |
|
| 7 |
export CC=clang |
| 8 |
export CFLAGS="-g -fsanitize=fuzzer-no-link,address,undefined \ |
| 9 |
-fno-sanitize=float-divide-by-zero,pointer-overflow \ |
| 10 |
-fno-sanitize-recover=all \ |
| 11 |
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION" |
| 12 |
|
| 13 |
Build libxml2 with instrumentation: |
| 14 |
|
| 15 |
cd /path/to/libxml2 |
| 16 |
./configure --without-python |
| 17 |
make |
| 18 |
|
| 19 |
Build libxslt with instrumentation: |
| 20 |
|
| 21 |
cd /path/to/libxslt |
| 22 |
./configure --without-python --with-libxml-src=/path/to/libxml2 |
| 23 |
make |
| 24 |
|
| 25 |
Run fuzzers: |
| 26 |
|
| 27 |
make -C tests/fuzz fuzz-xslt |
| 28 |
make -C tests/fuzz fuzz-xpath |
| 29 |
|