Improve the fuzztest.
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 9 Mar 2013 10:51:47 +0000 (12:51 +0200)
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>
Sat, 9 Mar 2013 10:51:47 +0000 (12:51 +0200)
Enable -fstack-protector-all to detect any stack smashing bugs. Also
use test_decode3 for maximal vulnerable surface.

tests/Makefile

index 7385fe3..181628a 100644 (file)
@@ -15,8 +15,8 @@ CC_VERSION=$(shell $(CC) -v 2>&1)
 CFLAGS_CORE=
 ifneq (,$(findstring gcc,$(CC_VERSION)))
        CFLAGS_CORE=-pedantic -Wextra -Wcast-qual -Wlogical-op -Wconversion
-        CFLAGS+=--coverage
-        LDFLAGS+=--coverage
+       CFLAGS+=--coverage -fstack-protector-all
+       LDFLAGS+=--coverage
 endif
 ifneq (,$(findstring clang,$(CC_VERSION)))
        CFLAGS_CORE=-pedantic -Wextra -Wcast-qual -Wconversion
@@ -127,5 +127,5 @@ test_options: options.pb.h options.expected options.pb.o
            fi \
        done
 
-run_fuzztest: test_decode2
-       bash -c 'I=1; while true; do cat /dev/urandom | ./test_decode2 > /dev/null; I=$$(($$I+1)); echo -en "\r$$I"; done'
+run_fuzztest: test_decode3
+       bash -c 'ulimit -c unlimited; I=1; while true; do cat /dev/urandom | ./test_decode3 > /dev/null; I=$$(($$I+1)); echo -en "\r$$I"; done'