Skip to content

Commit

Permalink
Problem: lack of out-of-bound memory checks in tests
Browse files Browse the repository at this point in the history
Solution: add a CI build run with GCC's Address Sanitizer enabled.
This compiler flag will make the unit test programs abort if it
detects errors such as out-of-bound memory access or use-after-free.
  • Loading branch information
bluca committed Mar 30, 2017
1 parent 7ce68da commit d3ca235
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ matrix:
- xmlto
- env: BUILD_TYPE=default CURVE=libsodium
os: osx
- env: BUILD_TYPE=default CURVE=tweetnacl DRAFT=enabled ADDRESS_SANITIZER=enabled
os: linux

sudo: required

Expand Down
5 changes: 5 additions & 0 deletions ci_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ if [ $BUILD_TYPE == "default" ]; then
CONFIG_OPTS+=("PKG_CONFIG_PATH=${BUILD_PREFIX}/lib/pkgconfig")
CONFIG_OPTS+=("--prefix=${BUILD_PREFIX}")

if [ -n "$ADDRESS_SANITIZER" ] && [ "$ADDRESS_SANITIZER" == "enabled" ]; then
CONFIG_OPTS+=("CFLAGS=-fsanitize=address")
CONFIG_OPTS+=("CXXFLAGS=-fsanitize=address")
fi

if [ -z $CURVE ]; then
CONFIG_OPTS+=("--disable-curve")
elif [ $CURVE == "libsodium" ]; then
Expand Down

0 comments on commit d3ca235

Please sign in to comment.