From ec79e889899cf8f30332657f3cea8277bf0798d9 Mon Sep 17 00:00:00 2001 From: mdimado Date: Mon, 2 Jun 2025 22:29:40 +0530 Subject: [PATCH 1/4] temporarily remove the decode bytes fuzz harness --- projects/goipp/fuzzer/fuzz_decode_bytes.go | 20 -------------------- projects/goipp/oss_fuzz_build.sh | 6 +++--- 2 files changed, 3 insertions(+), 23 deletions(-) delete mode 100644 projects/goipp/fuzzer/fuzz_decode_bytes.go diff --git a/projects/goipp/fuzzer/fuzz_decode_bytes.go b/projects/goipp/fuzzer/fuzz_decode_bytes.go deleted file mode 100644 index f316bab..0000000 --- a/projects/goipp/fuzzer/fuzz_decode_bytes.go +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Fuzz target for goipp's `DecodeBytes` function. - */ - - -package fuzzer - -import ( - "testing" - "github.com/OpenPrinting/goipp" -) - -func FuzzDecodeBytes(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { - var m goipp.Message - if err := m.DecodeBytes(data); err != nil { - t.Skip() - } - }) -} \ No newline at end of file diff --git a/projects/goipp/oss_fuzz_build.sh b/projects/goipp/oss_fuzz_build.sh index 9636779..918c139 100644 --- a/projects/goipp/oss_fuzz_build.sh +++ b/projects/goipp/oss_fuzz_build.sh @@ -1,7 +1,7 @@ #!/bin/bash -eu mkdir -p $SRC/goipp/fuzzer -cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_decode_bytes.go $SRC/goipp/fuzzer/ +# cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_decode_bytes.go $SRC/goipp/fuzzer/ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_decode_bytes_ex.go $SRC/goipp/fuzzer/ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_round_trip.go $SRC/goipp/fuzzer/ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_collections.go $SRC/goipp/fuzzer/ @@ -11,7 +11,7 @@ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_tag_extension.go $SRC/goipp/fuzzer/ mkdir -p $WORK/good_and_bad_ipp_messages_seed_corpus cp $SRC/fuzzing/projects/goipp/seeds/good_and_bad_ipp_messages_seed_corpus/* $WORK/good_and_bad_ipp_messages_seed_corpus/ cd $WORK -zip -r $OUT/fuzz_decode_bytes_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ +# zip -r $OUT/fuzz_decode_bytes_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ zip -r $OUT/fuzz_decode_bytes_ex_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ zip -r $OUT/fuzz_collections_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ @@ -31,7 +31,7 @@ go mod tidy go install github.com/AdamKorcz/go-118-fuzz-build@latest go get github.com/AdamKorcz/go-118-fuzz-build/testing -compile_native_go_fuzzer ./fuzzer FuzzDecodeBytes fuzz_decode_bytes +# compile_native_go_fuzzer ./fuzzer FuzzDecodeBytes fuzz_decode_bytes compile_native_go_fuzzer ./fuzzer FuzzDecodeBytesEx fuzz_decode_bytes_ex compile_native_go_fuzzer ./fuzzer FuzzRoundTrip fuzz_round_trip compile_native_go_fuzzer ./fuzzer FuzzCollections fuzz_collections From 4c05d67561a4f9b2ef8d159818897512dff99971 Mon Sep 17 00:00:00 2001 From: mdimado Date: Mon, 2 Jun 2025 22:32:33 +0530 Subject: [PATCH 2/4] add the decode bytes fuzz harness --- projects/goipp/oss_fuzz_build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/projects/goipp/oss_fuzz_build.sh b/projects/goipp/oss_fuzz_build.sh index 918c139..9636779 100644 --- a/projects/goipp/oss_fuzz_build.sh +++ b/projects/goipp/oss_fuzz_build.sh @@ -1,7 +1,7 @@ #!/bin/bash -eu mkdir -p $SRC/goipp/fuzzer -# cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_decode_bytes.go $SRC/goipp/fuzzer/ +cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_decode_bytes.go $SRC/goipp/fuzzer/ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_decode_bytes_ex.go $SRC/goipp/fuzzer/ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_round_trip.go $SRC/goipp/fuzzer/ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_collections.go $SRC/goipp/fuzzer/ @@ -11,7 +11,7 @@ cp $SRC/fuzzing/projects/goipp/fuzzer/fuzz_tag_extension.go $SRC/goipp/fuzzer/ mkdir -p $WORK/good_and_bad_ipp_messages_seed_corpus cp $SRC/fuzzing/projects/goipp/seeds/good_and_bad_ipp_messages_seed_corpus/* $WORK/good_and_bad_ipp_messages_seed_corpus/ cd $WORK -# zip -r $OUT/fuzz_decode_bytes_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ +zip -r $OUT/fuzz_decode_bytes_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ zip -r $OUT/fuzz_decode_bytes_ex_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ zip -r $OUT/fuzz_collections_seed_corpus.zip good_and_bad_ipp_messages_seed_corpus/ @@ -31,7 +31,7 @@ go mod tidy go install github.com/AdamKorcz/go-118-fuzz-build@latest go get github.com/AdamKorcz/go-118-fuzz-build/testing -# compile_native_go_fuzzer ./fuzzer FuzzDecodeBytes fuzz_decode_bytes +compile_native_go_fuzzer ./fuzzer FuzzDecodeBytes fuzz_decode_bytes compile_native_go_fuzzer ./fuzzer FuzzDecodeBytesEx fuzz_decode_bytes_ex compile_native_go_fuzzer ./fuzzer FuzzRoundTrip fuzz_round_trip compile_native_go_fuzzer ./fuzzer FuzzCollections fuzz_collections From 3f1fe996b56d24a03bf5e6a073ad3aca34d621ed Mon Sep 17 00:00:00 2001 From: mdimado Date: Mon, 2 Jun 2025 22:33:50 +0530 Subject: [PATCH 3/4] add the decode bytes fuzz harness --- projects/goipp/fuzzer/fuzz_decode_bytes.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 projects/goipp/fuzzer/fuzz_decode_bytes.go diff --git a/projects/goipp/fuzzer/fuzz_decode_bytes.go b/projects/goipp/fuzzer/fuzz_decode_bytes.go new file mode 100644 index 0000000..601407b --- /dev/null +++ b/projects/goipp/fuzzer/fuzz_decode_bytes.go @@ -0,0 +1,20 @@ +/* + * Fuzz target for goipp's DecodeBytes function. + */ + + +package fuzzer + +import ( + "testing" + "github.com/OpenPrinting/goipp" +) + +func FuzzDecodeBytes(f *testing.F) { + f.Fuzz(func(t *testing.T, data []byte) { + var m goipp.Message + if err := m.DecodeBytes(data); err != nil { + t.Skip() + } + }) +} \ No newline at end of file From 1abed27d851846edeff8e9d8faefcf2a9131ffd7 Mon Sep 17 00:00:00 2001 From: mdimado Date: Mon, 2 Jun 2025 22:38:06 +0530 Subject: [PATCH 4/4] rename the decode bytes fuzz harness --- projects/goipp/fuzzer/fuzz_decode_bytes.go | 2 +- projects/goipp/oss_fuzz_build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/goipp/fuzzer/fuzz_decode_bytes.go b/projects/goipp/fuzzer/fuzz_decode_bytes.go index 601407b..5719c0a 100644 --- a/projects/goipp/fuzzer/fuzz_decode_bytes.go +++ b/projects/goipp/fuzzer/fuzz_decode_bytes.go @@ -10,7 +10,7 @@ import ( "github.com/OpenPrinting/goipp" ) -func FuzzDecodeBytes(f *testing.F) { +func FuzzDecBytes(f *testing.F) { f.Fuzz(func(t *testing.T, data []byte) { var m goipp.Message if err := m.DecodeBytes(data); err != nil { diff --git a/projects/goipp/oss_fuzz_build.sh b/projects/goipp/oss_fuzz_build.sh index 9636779..0d954ca 100644 --- a/projects/goipp/oss_fuzz_build.sh +++ b/projects/goipp/oss_fuzz_build.sh @@ -31,7 +31,7 @@ go mod tidy go install github.com/AdamKorcz/go-118-fuzz-build@latest go get github.com/AdamKorcz/go-118-fuzz-build/testing -compile_native_go_fuzzer ./fuzzer FuzzDecodeBytes fuzz_decode_bytes +compile_native_go_fuzzer ./fuzzer FuzzDecBytes fuzz_decode_bytes compile_native_go_fuzzer ./fuzzer FuzzDecodeBytesEx fuzz_decode_bytes_ex compile_native_go_fuzzer ./fuzzer FuzzRoundTrip fuzz_round_trip compile_native_go_fuzzer ./fuzzer FuzzCollections fuzz_collections