Skip to content

Commit

Permalink
Add project utf8proc (#5030)
Browse files Browse the repository at this point in the history
* Add project utf8proc

* add Dockerfile, build.sh

* dummy commit

* dummy commit

* speculative fix

* Update build.sh

* Update build.sh

* Update build.sh

* Remove afl sanitizer.

Co-authored-by: Abhishek Arya <[email protected]>
  • Loading branch information
randy408 and inferno-chromium authored Jan 29, 2021
1 parent 4c4b137 commit 0e678a3
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 0 deletions.
28 changes: 28 additions & 0 deletions projects/utf8proc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 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.
#
################################################################################

FROM gcr.io/oss-fuzz-base/base-builder

RUN apt-get update && \
apt-get install -y wget tar

RUN git clone --depth 1 https://github.com/JuliaStrings/utf8proc.git

RUN wget -O $SRC/utf8proc/test/NormalizationTest.txt https://www.unicode.org/Public/13.0.0/ucd/NormalizationTest.txt
RUN wget -O $SRC/utf8proc/test/GraphemeBreakTest.txt https://www.unicode.org/Public/13.0.0/ucd/auxiliary/GraphemeBreakTest.txt

WORKDIR $SRC/utf8proc/
COPY build.sh $SRC/
33 changes: 33 additions & 0 deletions projects/utf8proc/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash -eu
# Copyright 2021 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.
#
################################################################################
# Run the OSS-Fuzz script in the project
#$SRC/utf8proc/test/ossfuzz.sh #broken, for now

mkdir build
cd build
cmake ..
make -j$(nproc)


$CC $CFLAGS -I$SRC/utf8proc \
$SRC/utf8proc/test/fuzzer.c \
-o $OUT/utf8proc_fuzzer \
$LIB_FUZZING_ENGINE $SRC/utf8proc/build/libutf8proc.a


find $SRC/utf8proc/test -name "*.txt" | \
xargs zip $OUT/utf8proc_fuzzer_seed_corpus.zip
14 changes: 14 additions & 0 deletions projects/utf8proc/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
homepage: "http://juliastrings.github.io/utf8proc/"
language: c
primary_contact: "[email protected]"
auto_ccs:
- "[email protected]"
sanitizers:
- address
- memory
- undefined
fuzzing_engines:
- libfuzzer
- honggfuzz
main_repo: 'https://github.com/JuliaStrings/utf8proc'

0 comments on commit 0e678a3

Please sign in to comment.