forked from tealeg/xlsx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuzzit.sh
More file actions
executable file
·35 lines (31 loc) · 819 Bytes
/
fuzzit.sh
File metadata and controls
executable file
·35 lines (31 loc) · 819 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
set -xe
# Validate arguments
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <fuzz-type>"
exit 1
fi
if [ -z "$FUZZIT_API_KEY" ]; then
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo "Set FUZZIT_API_KEY to your Fuzzit API key"
exit 2
else
echo "Skipping FUZZIT because no key was available for the pull request"
exit 0
fi
fi
# Configure
NAME=xlsx
TYPE=$1
# Setup
export GO111MODULE="off"
go get -u github.com/dvyukov/go-fuzz/go-fuzz github.com/dvyukov/go-fuzz/go-fuzz-build
go get -d -v -u ./...
if [ ! -f fuzzit ]; then
wget -q -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v2.4.29/fuzzit_Linux_x86_64
chmod a+x fuzzit
fi
# Fuzz
go-fuzz-build -libfuzzer -o fuzzer.a .
clang -fsanitize=fuzzer fuzzer.a -o fuzzer
./fuzzit create job --type $TYPE $NAME fuzzer