From 3634c4593f2d9999dca2d7a02e23edc29bf7bd11 Mon Sep 17 00:00:00 2001 From: Mohammed Al Sahaf Date: Thu, 2 Apr 2020 19:40:21 +0300 Subject: [PATCH] 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. --- caddyconfig/caddyfile/parse_fuzz.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/caddyconfig/caddyfile/parse_fuzz.go b/caddyconfig/caddyfile/parse_fuzz.go index 3214e1dd..8e8ea73f 100644 --- a/caddyconfig/caddyfile/parse_fuzz.go +++ b/caddyconfig/caddyfile/parse_fuzz.go @@ -16,7 +16,12 @@ package caddyfile +import "bytes" + func FuzzParseCaddyfile(data []byte) (score int) { + if bytes.Contains(data, []byte("import")) { + return -1 + } sb, err := Parse("Caddyfile", data) if err != nil { // if both an error is received and some ServerBlocks,