Skip to content

Commit

Permalink
native go fuzzing: Restrict fuzzer lookup to *.go (#8238)
Browse files Browse the repository at this point in the history
native go fuzzing: Restrict fuzzer lookup to *.go
Projects containing words starting with Fuzz in non-go
files break compile_native_go_fuzzer with the error:
sed: -e expression #1, char 15: unknown option to 's'

Signed-off-by: Paulo Gomes <pjbgf@linux.com>

Signed-off-by: Paulo Gomes <pjbgf@linux.com>
  • Loading branch information
pjbgf committed Aug 17, 2022
1 parent c113501 commit 0b416da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion infra/base-images/base-builder/compile_native_go_fuzzer
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ tags="-tags gofuzz"
abs_file_dir=$(go list $tags -f {{.Dir}} $path)

# TODO(adamkorcz): Get rid of "-r" flag here.
fuzzer_filename=$(grep -r -l -s "$function" "${abs_file_dir}")
fuzzer_filename=$(grep -r -l --include='*.go' -s "$function" "${abs_file_dir}")

# Test if file contains a line with "func $function" and "testing.F".
if [ $(grep -r "func $function" $fuzzer_filename | grep "testing.F" | wc -l) -eq 1 ]
Expand Down

0 comments on commit 0b416da

Please sign in to comment.