mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-24 16:59:00 +01:00
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.
This commit is contained in:
parent
7ca15861dd
commit
3634c4593f
1 changed files with 5 additions and 0 deletions
|
@ -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…
Reference in a new issue