| 1 |
package packfile |
| 2 |
|
| 3 |
import ( |
| 4 |
"bytes" |
| 5 |
"testing" |
| 6 |
) |
| 7 |
|
| 8 |
func FuzzDecodeLEB128(f *testing.F) { |
| 9 |
f.Add([]byte{0x01}) |
| 10 |
f.Add([]byte{0x80, 0x01}) |
| 11 |
f.Add(bytes.Repeat([]byte{0x80}, 12)) |
| 12 |
|
| 13 |
f.Fuzz(func(_ *testing.T, data []byte) { |
| 14 |
_, _, _ = decodeLEB128(data) |
| 15 |
}) |
| 16 |
} |
| 17 |
|
| 18 |
func FuzzDecodeLEB128ByteReader(f *testing.F) { |
| 19 |
f.Add([]byte{0x01}) |
| 20 |
f.Add([]byte{0x80, 0x01}) |
| 21 |
f.Add(bytes.Repeat([]byte{0x80}, 12)) |
| 22 |
|
| 23 |
f.Fuzz(func(_ *testing.T, data []byte) { |
| 24 |
_, _ = decodeLEB128ByteReader(bytes.NewReader(data)) |
| 25 |
}) |
| 26 |
} |