mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Fix a crash in rewrite plugin when rule type is missing (#5459)
This commit is contained in:
@@ -104,6 +104,9 @@ func newRule(args ...string) (Rule, error) {
|
||||
expectNumArgs = len(args) - 1
|
||||
startArg = 2
|
||||
case Stop:
|
||||
if len(args) < 2 {
|
||||
return nil, fmt.Errorf("stop rule must begin with a rule type")
|
||||
}
|
||||
ruleType = strings.ToLower(args[1])
|
||||
expectNumArgs = len(args) - 1
|
||||
startArg = 2
|
||||
|
||||
Reference in New Issue
Block a user