mirror of
https://github.com/status-im/markdown.git
synced 2025-02-22 08:08:18 +00:00
add fuzzing driver and crashes found with it
This commit is contained in:
parent
373bb10556
commit
339c59ffbe
9
fuzz.go
Normal file
9
fuzz.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
// +build gofuzz
|
||||||
|
|
||||||
|
package markdown
|
||||||
|
|
||||||
|
// Fuzz is to be used by https://github.com/dvyukov/go-fuzz
|
||||||
|
func Fuzz(data []byte) int {
|
||||||
|
Parse(data, nil)
|
||||||
|
return 0
|
||||||
|
}
|
27
fuzz_crashes_test.go
Normal file
27
fuzz_crashes_test.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package markdown
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
// crashes found with go-fuzz
|
||||||
|
|
||||||
|
func TestCrash1(t *testing.T) {
|
||||||
|
tests := []string{
|
||||||
|
": \n\n0\n00",
|
||||||
|
">>>0```\n\n:\n```",
|
||||||
|
">0```\n: \n\n0\n```",
|
||||||
|
">>>>0```\n\n:\n```",
|
||||||
|
"0\n\n:\n00",
|
||||||
|
">>0```\n\n:\n```",
|
||||||
|
"[0]:<",
|
||||||
|
"[[[[[[\n\t: ]]]]]]\n\n: " + "\n\n:(()",
|
||||||
|
">0\n>\n:\n00",
|
||||||
|
": : \n\n\t0\n00",
|
||||||
|
"0\n: : \n\n\t0\n00",
|
||||||
|
"0\n\n:\n00",
|
||||||
|
"0\n\n: [0]:<",
|
||||||
|
"[0]:<",
|
||||||
|
}
|
||||||
|
for _, test := range tests {
|
||||||
|
Parse([]byte(test), nil)
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user