mirror of https://github.com/google/oss-fuzz.git
sharp: add seed corpus (#12256)
This commit is contained in:
parent
5c99ed9f0e
commit
dd3e38d3e8
|
@ -16,6 +16,8 @@
|
|||
|
||||
FROM gcr.io/oss-fuzz-base/base-builder-javascript
|
||||
|
||||
RUN mkdir afl-testcases
|
||||
RUN curl https://lcamtuf.coredump.cx/afl/demo/afl_testcases.tgz | tar xzC afl-testcases
|
||||
RUN git clone --depth 1 https://github.com/lovell/sharp.git
|
||||
|
||||
COPY build.sh $SRC/
|
||||
|
|
|
@ -22,3 +22,12 @@ npm install --save-dev @jazzer.js/core
|
|||
|
||||
# Build Fuzzers.
|
||||
compile_javascript_fuzzer sharp fuzz.js -i sharp
|
||||
|
||||
# Merge the seed corpus in a single directory, exclude files larger than 4k
|
||||
mkdir -p fuzz/corpus
|
||||
find \
|
||||
$SRC/afl-testcases/{gif*,jpeg*,png,tiff,webp}/full/images \
|
||||
test/fixtures \
|
||||
-type f -size -4k \
|
||||
-exec bash -c 'hash=($(sha1sum {})); mv {} fuzz/corpus/$hash' \;
|
||||
zip -jrq $OUT/fuzz_seed_corpus.zip fuzz/corpus
|
||||
|
|
Loading…
Reference in New Issue