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
fuzz: Remove Caddyfile adapter from fuzz corpus (#2925)
The Caddyfile adapter does not need to be fuzzed, as all it really does is invoke the Caddyfile parser, which is already fuzzed
Matt Holt committed
Dec 10, 2019 at 15:00 UTC
2e0615270d157beb293bfce832a8a39bc6f2e749
2 files changed
-45
azure-pipelines.yml
-2
@@ -206,7 +206,6 @@ jobs:
206
207
- bash: |
208
declare -A fuzzers_funcs=(\
209
- ["./caddyconfig/httpcaddyfile/adapter_fuzz.go"]="FuzzHTTPCaddyfileAdapter" \
209
["./caddyconfig/httpcaddyfile/addresses_fuzz.go"]="FuzzParseAddress" \
210
["./caddyconfig/caddyfile/parse_fuzz.go"]="FuzzParseCaddyfile" \
211
["./listeners_fuzz.go"]="FuzzParseNetworkAddress" \
@@ -214,7 +213,6 @@ jobs:
213
)
214
215
declare -A fuzzers_targets=(\
217
- ["./caddyconfig/httpcaddyfile/adapter_fuzz.go"]="caddyfile-adapter" \
216
["./caddyconfig/httpcaddyfile/addresses_fuzz.go"]="parse-address" \
217
["./caddyconfig/caddyfile/parse_fuzz.go"]="parse-caddyfile" \
218
["./listeners_fuzz.go"]="parse-network-address" \
caddyconfig/httpcaddyfile/adapter_fuzz.go
deleted
-43
@@ -1,43 +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
-// +build gofuzz_libfuzzer
17
-
18
-package httpcaddyfile
19
-
20
-import (
21
- "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
22
-)
23
-
24
-func FuzzHTTPCaddyfileAdapter(data []byte) int {
25
- adapter := caddyfile.Adapter{
26
- ServerType: ServerType{},
27
- }
28
-
29
- _, warns, err := adapter.Adapt(data, nil)
30
-
31
- // Adapt func calls the Setup() func of the ServerType,
32
- // thus it's going across multiple layers, each can
33
- // return warnings or errors. Marking the presence of
34
- // errors or warnings as interesting in this case
35
- // could push the fuzzer towards a path where we only
36
- // catch errors. Let's push the fuzzer to where it passes
37
- // but breaks.
38
- if err != nil || (warns != nil && len(warns) > 0) {
39
- return 0
40
- }
41
-
42
- return 1
43
-}