@marcel91200 / caddy Mirror · read-only / commits / bae4f15f
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

ci: fuzz: remove the fuzzer of the Caddyfile parser (#3288)

Mohammed Al Sahaf committed Apr 21, 2020 at 00:21 UTC bae4f15fad6acb8db288d3add565193d27961eb4
2 files changed -38
.github/workflows/fuzzing.yml
-2
@@ -48,14 +48,12 @@ jobs:
48
49 declare -A fuzzers_funcs=(\
50 ["./caddyconfig/httpcaddyfile/addresses_fuzz.go"]="FuzzParseAddress" \
51 - ["./caddyconfig/caddyfile/parse_fuzz.go"]="FuzzParseCaddyfile" \
51 ["./listeners_fuzz.go"]="FuzzParseNetworkAddress" \
52 ["./replacer_fuzz.go"]="FuzzReplacer" \
53 )
54
55 declare -A fuzzers_targets=(\
56 ["./caddyconfig/httpcaddyfile/addresses_fuzz.go"]="parse-address" \
58 - ["./caddyconfig/caddyfile/parse_fuzz.go"]="parse-caddyfile" \
57 ["./listeners_fuzz.go"]="parse-network-address" \
58 ["./replacer_fuzz.go"]="replacer" \
59 )
caddyconfig/caddyfile/parse_fuzz.go deleted
-36
@@ -1,36 +0,0 @@
1 -// Copyright 2015 Matthew Holt and The Caddy Authors
2 -//
3 -// Licensed under the Apache License, Version 2.0 (the "License");
4 -// you may not use this file except in compliance with the License.
5 -// You may obtain a copy of the License at
6 -//
7 -// http://www.apache.org/licenses/LICENSE-2.0
8 -//
9 -// Unless required by applicable law or agreed to in writing, software
10 -// distributed under the License is distributed on an "AS IS" BASIS,
11 -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 -// See the License for the specific language governing permissions and
13 -// limitations under the License.
14 -
15 -// +build gofuzz
16 -
17 -package caddyfile
18 -
19 -import "bytes"
20 -
21 -func FuzzParseCaddyfile(data []byte) (score int) {
22 - if bytes.Contains(data, []byte("import")) {
23 - return -1
24 - }
25 - sb, err := Parse("Caddyfile", data)
26 - if err != nil {
27 - // if both an error is received and some ServerBlocks,
28 - // then the parse was able to parse partially. Mark this
29 - // result as interesting to push the fuzzer further through the parser.
30 - if sb != nil && len(sb) > 0 {
31 - return 1
32 - }
33 - return 0
34 - }
35 - return 1
36 -}