Skip to content

Commit 078779c

Browse files
committed
add fuzz test for IsISO9660
Signed-off-by: Adam Korczynski <[email protected]>
1 parent 0cfd535 commit 078779c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pkg/iso9660util/fuzz_test.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package iso9660util
2+
3+
import (
4+
"os"
5+
"path/filepath"
6+
"testing"
7+
)
8+
9+
func FuzzIsISO9660(f *testing.F) {
10+
f.Fuzz(func(t *testing.T, fileContents []byte) {
11+
imageFile := filepath.Join(t.TempDir(), "fuzz.iso")
12+
err := os.WriteFile(imageFile, fileContents, 0o600)
13+
if err != nil {
14+
t.Fatal(err)
15+
}
16+
//nolint:errcheck // The test doesn't check the return value
17+
IsISO9660(imageFile)
18+
})
19+
}

0 commit comments

Comments
 (0)