Browse Source

ci: fuzz: skip fuzz data that contains `import` (#3214)

Thus far the fuzzers have found a few crashers in the Caddyfile parser. However, the fuzzer have been stuck at import glob expansion after import glob expansion, which aren't reproducible.
master
Mohammed Al Sahaf 5 years ago
committed by GitHub
parent
commit
3634c4593f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      caddyconfig/caddyfile/parse_fuzz.go

5
caddyconfig/caddyfile/parse_fuzz.go

@ -16,7 +16,12 @@
package caddyfile package caddyfile
import "bytes"
func FuzzParseCaddyfile(data []byte) (score int) { func FuzzParseCaddyfile(data []byte) (score int) {
if bytes.Contains(data, []byte("import")) {
return -1
}
sb, err := Parse("Caddyfile", data) sb, err := Parse("Caddyfile", data)
if err != nil { if err != nil {
// if both an error is received and some ServerBlocks, // if both an error is received and some ServerBlocks,

Loading…
Cancel
Save