diff --git a/.travis.yml b/.travis.yml index c9dc29b..d2c9e0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,28 +2,39 @@ language: cpp dist: xenial compiler: clang +branches: + only: + - master + stages: - name: Fuzzing -# if: type = cron jobs: include: - stage: Fuzzing - name: Continuous Fuzzing via Fuzzit (fuzzing daily) + name: Continuous Fuzzing via Fuzzit language: bash compiler: clang script: - - export CC=`which clang` - - export CXX=`which clang++` - - mkdir -p build - - cd build - - cmake .. -DCMAKE_BUILD_TYPE=AddressSanitizer - - make - - wget -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v1.2.5/fuzzit_1.2.5_Linux_x86_64 - - chmod a+x fuzzit - - ./fuzzit auth ${FUZZIT_AUTH_KEY} - - export TARGET_ID=Ba04ssna9qEd7bwN27Xz - - ./fuzzit create job --branch ${TRAVIS_BRANCH} --revision ${TRAVIS_COMMIT} ${TARGET_ID} ./fuzz/fuzz_test_string + - | + if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then + export FUZZING_TYPE="fuzzing" + export BRANCH=${TRAVIS_BRANCH} + else + export FUZZING_TYPE="sanity" + export BRANCH=${TRAVIS_PULL_REQUEST} + fi + export CC=`which clang` + export CXX=`which clang++` + mkdir -p build + cd build + cmake .. -DCMAKE_BUILD_TYPE=AddressSanitizer + make + wget -O fuzzit https://github.com/fuzzitdev/fuzzit/releases/download/v1.2.5/fuzzit_1.2.5_Linux_x86_64 + chmod a+x fuzzit + ./fuzzit auth ${FUZZIT_AUTH_KEY} + export TARGET_ID=Ba04ssna9qEd7bwN27Xz + ./fuzzit create job --type ${FUZZING_TYPE} --branch ${BRANCH} --revision ${TRAVIS_COMMIT} ${TARGET_ID} ./fuzz/fuzz_test_string env: global: diff --git a/README.md b/README.md index 801df4e..76cc319 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![Build Status](https://travis-ci.org/fuzzitdev/example.svg?branch=master)](https://travis-ci.org/fuzzitdev/example) ![fuzzit](https://app.fuzzit.dev/badge?org_id=hP8u8bNAda91Cnj0mKPX&branch=master) # Continuous Fuzzing Example diff --git a/src/test_string.cpp b/src/test_string.cpp index e71cfb2..4fe74bf 100644 --- a/src/test_string.cpp +++ b/src/test_string.cpp @@ -12,7 +12,7 @@ int test_string(const char *src, size_t len) } else { if (strncmp(src, FLAG, strlen(FLAG)) == 0) { // TRIGGER HEAP OVERFLOW READ - if (src[len] == 0) { + if (src[len-1] == 0) { return -2; } return -1;