Debian Codegraph @

plumbing/format/packfile/scanner_fuzz_test.go

raw
1 package packfile
2
3 import (
4 "bytes"
5 "testing"
6 )
7
8 func FuzzReadLength(f *testing.F) {
9 f.Add(byte(0x90), []byte{0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80})
10 f.Add(byte(0x80), []byte{0x01})
11 f.Add(byte(0x00), []byte{})
12
13 f.Fuzz(func(_ *testing.T, first byte, tail []byte) {
14 s := NewScanner(bytes.NewReader(tail))
15 _, _ = s.readLength(first)
16 })
17 }