summaryrefslogtreecommitdiff
path: root/examples/libjpeg/README.md
diff options
context:
space:
mode:
authorThiƩbaud Weksteen <tweek@google.com>2020-12-08 09:10:07 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-12-08 09:10:07 +0000
commitbee061e2443c8cdd345eb2408aec5a2f02a75e34 (patch)
treef69b47eeac6303e4f0ba33c3e347536956b31609 /examples/libjpeg/README.md
parent159c091fd5d180ab747898f9f9322e106767fe25 (diff)
parent5fb79d2bbb42ccef4dac08b263d0f7bd53bae521 (diff)
downloadhonggfuzz-bee061e2443c8cdd345eb2408aec5a2f02a75e34.tar.gz
Merge "Merge tag '2.3' into master" am: 5fb79d2bbb
Original change: https://android-review.googlesource.com/c/platform/external/honggfuzz/+/1506307 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I2cf6dedcccf292fa07ebbcc88e49bf771b0f8a0b
Diffstat (limited to 'examples/libjpeg/README.md')
-rw-r--r--examples/libjpeg/README.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/examples/libjpeg/README.md b/examples/libjpeg/README.md
new file mode 100644
index 00000000..10dc2918
--- /dev/null
+++ b/examples/libjpeg/README.md
@@ -0,0 +1,43 @@
+# Fuzzing libjpeg(-turbo) #
+
+**Requirements**
+
+ * honggfuzz
+ * clang-5.0, or newer
+ * libjpeg9, or libjpeg-turbo
+
+**Preparation**
+
+1. Compile honggfuzz
+2. Unpack/Clone libjpeg(-turbo)
+
+3. Configure+Compile libjpeg(-turbo)
+
+```shell
+CC=<your_hfuzz_dir>/hfuzz_cc/hfuzz-clang CXX=<your_hfuzz_dir>/hfuzz_cc/hfuzz-clang++ CFLAGS="-fsanitize=address" ./configure
+make -j$(nproc)
+```
+
+4. Compile fuzzing targets
+
+```shell
+$ <your_hfuzz_dir>/hfuzz_cc/hfuzz-clang -I ./jpeg-9c/ <your_hfuzz_dir>/examples/libjpeg/persistent-jpeg.c -o persistent.jpeg9.address jpeg-9c/.libs/libjpeg.a -fsanitize=address
+```
+
+or
+
+```shell
+$ <your_hfuzz_dir>/hfuzz_cc/hfuzz-clang -I ./libjpeg-turbo-2.0.3/ -I ./libjpeg-turbo-2.0.3/out/ <your_hfuzz_dir>/examples/libjpeg/persistent-jpeg.c -o persistent.jpeg-turbo.address libjpeg-turbo-2.0.3/out/libjpeg.a -fsanitize=address
+```
+
+**Fuzzing**
+
+```shell
+$ honggfuzz -i initial_corpus --rlimit_rss 2048 -- ./persistent.jpeg9.address
+```
+
+or
+
+```
+$ honggfuzz -i initial_corpus --rlimit_rss 2048 -- ./persistent.jpeg-turbo.address
+```