Skip to content

Commit

Permalink
Adds thrift project
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Mar 26, 2021
1 parent 54f0985 commit 327e6bb
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
21 changes: 21 additions & 0 deletions projects/thrift/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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 libssl-dev pkg-config autoconf automake libtool bison flex libboost-all-dev
RUN git clone --depth 1 https://github.com/apache/thrift
WORKDIR $SRC/thrift
COPY build.sh $SRC/
32 changes: 32 additions & 0 deletions projects/thrift/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/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.
#
################################################################################

# build project
export ASAN_OPTIONS=detect_leaks=0

./bootstrap.sh
# rust fails compilation with clippy warnings
./configure --with-rs=no
make -j$(nproc)
make install

cd lib/go/test/fuzz
thrift -r --gen go ../../../../tutorial/tutorial.thrift
(cd ./gen-go/shared && go mod init shared)
(cd ./gen-go/tutorial && go mod init tutorial)
go mod tidy || true
compile_go_fuzzer . Fuzz fuzz_go_tutorial
11 changes: 11 additions & 0 deletions projects/thrift/project.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
homepage: "https://thrift.apache.org/"
language: c++
primary_contact: "[email protected]"
auto_ccs :
- "[email protected]"

fuzzing_engines:
- libfuzzer
sanitizers:
- address
main_repo: 'https://github.com/apache/thrift'

0 comments on commit 327e6bb

Please sign in to comment.