ghostscript: extend with eps2write device fuzzer (#8258)

* ghostscript: extend with eps2write device fuzzer

eps2write is one of the high-level devices currently not targeted by the
fuzzing suite. This adds a fuzzer for this high-level device.

* cleanup build
This commit is contained in:
DavidKorczynski 2022-08-15 15:43:12 +01:00 committed by GitHub
parent 6929137715
commit 4ec2c13401
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -45,7 +45,7 @@ CPPFLAGS="${CPPFLAGS:-} $CUPS_CFLAGS -DPACIFY_VALGRIND" ./autogen.sh \
CUPSCONFIG=$CUPSCONFIG \
--enable-freetype --enable-fontconfig \
--enable-cups --with-ijs --with-jbig2dec \
--with-drivers=pdfwrite,cups,ljet4,laserjet,pxlmono,pxlcolor,pcl3,uniprint,pgmraw,ps2write,png16m,tiffsep1,faxg3,psdcmyk
--with-drivers=pdfwrite,cups,ljet4,laserjet,pxlmono,pxlcolor,pcl3,uniprint,pgmraw,ps2write,png16m,tiffsep1,faxg3,psdcmyk,eps2write
make -j$(nproc) libgs
fuzzers="gstoraster_fuzzer \
@ -58,6 +58,7 @@ fuzzers="gstoraster_fuzzer \
gs_device_ps2write_fuzzer \
gs_device_png16m_fuzzer \
gs_device_psdcmyk_fuzzer \
gs_device_eps2write_fuzzer \
gs_device_faxg3_fuzzer \
gs_device_tiffsep1_fuzzer"
@ -96,6 +97,7 @@ done
zip -j "$OUT/gstoraster_fuzzer_seed_corpus.zip" "$WORK"/seeds/*
cp "$OUT/gstoraster_fuzzer_seed_corpus.zip" "$OUT/gs_device_pdfwrite_fuzzer_seed_corpus.zip"
cp "$OUT/gstoraster_fuzzer_seed_corpus.zip" "$OUT/gs_device_pxlmono_fuzzer_seed_corpus.zip"
cp "$OUT/gstoraster_fuzzer_seed_corpus.zip" "$OUT/gs_device_eps2write_fuzzer_seed_corpus.zip"
# Copy out options
cp $SRC/*.options $OUT/

View File

@ -0,0 +1,20 @@
/* Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include "gs_fuzzlib.h"
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
fuzz_gs_device(data, size, 1, "eps2write", "/dev/null");
return 0;
}