Skip to content

Commit

Permalink
fuzzing regex(3): add support for sanitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
plusun committed Jul 22, 2018
1 parent 4b956b7 commit 99b4551
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/fuzz/regex/libc/regcomp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SRCS= fuzz_regcomp.c
.PATH: ${NETBSDSRCDIR}/lib/libc/regex
SRCS+= regcomp.c regerror.c regexec.c regfree.c regsub.c

CPPFLAGS+=-I${NETBSDSRCDIR}/lib/libc/include
CPPFLAGS+=-I${NETBSDSRCDIR}/lib/libc/include -Dregnsub=__mkfuzzer_regnsub -Dregasub=__mkfuzzer_regasub

fuzz: fuzz_regcomp
./fuzz_regcomp -only_ascii=1 -dict=./dict ./input > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzz/regex/libc/regexec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SRCS= fuzz_regexec.c
.PATH: ${NETBSDSRCDIR}/lib/libc/regex
SRCS+= regcomp.c regerror.c regexec.c regfree.c regsub.c

CPPFLAGS+=-I${NETBSDSRCDIR}/lib/libc/include
CPPFLAGS+=-I${NETBSDSRCDIR}/lib/libc/include -Dregnsub=__mkfuzzer_regnsub -Dregasub=__mkfuzzer_regasub -g
NOMAN= # defined

fuzz: fuzz_regexec
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzz/regex/nvi/regcomp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SRCS= fuzz_regcomp.c
.PATH: ${NETBSDSRCDIR}/external/bsd/nvi/dist/regex
SRCS+= regcomp.c regerror.c regexec.c regfree.c

CPPFLAGS+= -I${NETBSDSRCDIR}/external/bsd/nvi/usr.bin/nvi -I${NETBSDSRCDIR}/external/bsd/nvi/dist/regex -D__REGEX_PRIVATE -DUSE_WIDECHAR
CPPFLAGS+= -I${NETBSDSRCDIR}/external/bsd/nvi/usr.bin/nvi -I${NETBSDSRCDIR}/external/bsd/nvi/dist/regex -D__REGEX_PRIVATE -DUSE_WIDECHAR -D__REGEX_PRIVATE -DUSE_WIDECHAR -Dregcomp=__mkfuzzer_regcomp -Dregerror=__mkfuzzer_regerror -Dregexec=__mkfuzzer_regexec -Dregfree=__mkfuzzer_regfree -g

This comment has been minimized.

Copy link
@krytarowski

krytarowski Jul 22, 2018

Collaborator

I think that -g is CFLAGS+=.


fuzz: fuzz_regcomp
./fuzz_regcomp -only_ascii=1 -dict=./dict ./input > /dev/null
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzz/regex/nvi/regexec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ SRCS= fuzz_regexec.c
.PATH: ${NETBSDSRCDIR}/external/bsd/nvi/dist/regex
SRCS+= regcomp.c regerror.c regexec.c regfree.c

CPPFLAGS+= -I${NETBSDSRCDIR}/external/bsd/nvi/usr.bin/nvi -I${NETBSDSRCDIR}/external/bsd/nvi/dist/regex -D__REGEX_PRIVATE -DUSE_WIDECHAR
CPPFLAGS+= -I${NETBSDSRCDIR}/external/bsd/nvi/usr.bin/nvi -I${NETBSDSRCDIR}/external/bsd/nvi/dist/regex -D__REGEX_PRIVATE -DUSE_WIDECHAR -Dregcomp=__mkfuzzer_regcomp -Dregerror=__mkfuzzer_regerror -Dregexec=__mkfuzzer_regexec -Dregfree=__mkfuzzer_regfree -g

fuzz: fuzz_regexec
./fuzz_regexec -only_ascii=1 -dict=./dict ./input > /dev/null
Expand Down

0 comments on commit 99b4551

Please sign in to comment.