2016-12-02 02:06:48 +00:00
|
|
|
#!/bin/bash -eu
|
|
|
|
# Copyright 2016 Google Inc.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
./bootstrap
|
|
|
|
./configure
|
|
|
|
make "-j$(nproc)"
|
|
|
|
|
[libyaml] Add more fuzz targets (#4043)
* added draco integration files
* wrote build file and Dockerfile for Draco
* added more fuzzers, updated build script to generate corpus and options for each
* place yaml.dict in SRC first, rather than in OUT directly
* changed fuzzers from c++ to c, updated build script
* started using booleans instead of ints, updated naming conventions
* replaced all instances of with
* removed memsets, stopped using first two bytes of input, and removed file I/O
* fixed style, changed function return types to bool instead of int
* added libyaml_parser_fuzzer back, implemented string handling to not exceed buffer size in libyaml_emitter_fuzzer, and made style fixes
* changed boolean functions to return error, not success
* fixed inverted check
* changed variable names, fixed crash in libyaml_emitter_fuzzer
* fixed addition/subtraction style
* make a dynamically growing heap buffer
* place yaml_write_handler in distinct header file, style fixes
* fix style and memory safety issues in reformatter fuzzers, remove unused vars
* consistent assignment of done variables
2020-08-12 22:44:24 +00:00
|
|
|
for fuzzer in $SRC/*_fuzzer.c; do
|
|
|
|
fuzzer_basename=$(basename -s .c $fuzzer)
|
2016-12-02 02:06:48 +00:00
|
|
|
|
[libyaml] Add more fuzz targets (#4043)
* added draco integration files
* wrote build file and Dockerfile for Draco
* added more fuzzers, updated build script to generate corpus and options for each
* place yaml.dict in SRC first, rather than in OUT directly
* changed fuzzers from c++ to c, updated build script
* started using booleans instead of ints, updated naming conventions
* replaced all instances of with
* removed memsets, stopped using first two bytes of input, and removed file I/O
* fixed style, changed function return types to bool instead of int
* added libyaml_parser_fuzzer back, implemented string handling to not exceed buffer size in libyaml_emitter_fuzzer, and made style fixes
* changed boolean functions to return error, not success
* fixed inverted check
* changed variable names, fixed crash in libyaml_emitter_fuzzer
* fixed addition/subtraction style
* make a dynamically growing heap buffer
* place yaml_write_handler in distinct header file, style fixes
* fix style and memory safety issues in reformatter fuzzers, remove unused vars
* consistent assignment of done variables
2020-08-12 22:44:24 +00:00
|
|
|
$CC $CFLAGS \
|
|
|
|
-I $SRC -Iinclude \
|
|
|
|
-c $fuzzer -o $fuzzer_basename.o
|
|
|
|
|
|
|
|
$CXX $CXXFLAGS \
|
|
|
|
-std=c++11 \
|
|
|
|
$fuzzer_basename.o \
|
|
|
|
-o $OUT/$fuzzer_basename \
|
|
|
|
$LIB_FUZZING_ENGINE \
|
|
|
|
src/.libs/libyaml.a
|
|
|
|
|
|
|
|
cp $SRC/libyaml_seed_corpus.zip "${OUT}/${fuzzer_basename}_seed_corpus.zip"
|
|
|
|
cp $SRC/libyaml_fuzzer.options "${OUT}/${fuzzer_basename}.options"
|
|
|
|
done
|
|
|
|
|
|
|
|
cp $SRC/yaml.dict $OUT/
|