-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Exiv2. * Remove sanitizer flags so that OSS-Fuzz can insert its own. * Using the fuzzer to create the seed corpus doesn't work with AFL. * Only use libFuzzer * Don't add files over 20KB to the corpus. * Use ${LIB_FUZZING_ENGINE} when building the fuzz target.
- Loading branch information
1 parent
a4bc239
commit c0b2a00
Showing
3 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2021 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. | ||
# | ||
################################################################################ | ||
FROM gcr.io/oss-fuzz-base/base-builder | ||
|
||
RUN apt-get update && apt-get install -y cmake make ccache python3 libexpat1-dev zlib1g-dev libssh-dev libcurl4-openssl-dev libxml2-utils | ||
RUN git clone https://github.com/Exiv2/exiv2 exiv2 | ||
WORKDIR exiv2 | ||
|
||
COPY build.sh $SRC/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash -eu | ||
# Copyright 2021 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. | ||
# | ||
################################################################################ | ||
|
||
pwd | ||
mkdir -p build | ||
cd build | ||
cmake -DEXIV2_ENABLE_PNG=ON -DEXIV2_ENABLE_WEBREADY=ON -DEXIV2_ENABLE_CURL=OFF -DEXIV2_ENABLE_BMFF=ON -DEXIV2_TEAM_WARNINGS_AS_ERRORS=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_CXX_COMPILER="${CXX}" -DCMAKE_CXX_FLAGS="${CXXFLAGS}" -DEXIV2_BUILD_FUZZ_TESTS=ON -DEXIV2_TEAM_OSS_FUZZ=ON -DLIB_FUZZING_ENGINE="${LIB_FUZZING_ENGINE}" .. | ||
make -j $(nproc) | ||
|
||
# Copy binary and dictionary to $OUT | ||
cp ./bin/fuzz-read-print-write $OUT | ||
cp ../fuzz/exiv2.dict $OUT/fuzz-read-print-write.dict | ||
|
||
# Initialize the corpus, using the files in test/data | ||
mkdir corpus | ||
for f in $(find ../test/data -type f -size -20k); do | ||
s=$(sha1sum "$f" | awk '{print $1}') | ||
cp $f corpus/$s | ||
done | ||
|
||
zip -j $OUT/fuzz-read-print-write.zip corpus/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
homepage: "https://www.exiv2.org" | ||
language: c++ | ||
primary_contact: "[email protected]" | ||
sanitizers: | ||
- address | ||
- undefined | ||
architectures: | ||
- x86_64 | ||
main_repo: 'https://github.com/Exiv2/exiv2' |