diff options
author | 2022-02-07 06:09:12 -0800 | |
---|---|---|
committer | 2022-02-07 09:09:12 -0500 | |
commit | 041e1eabc6022cba5e59a8b99d4226dea2bc4b0a (patch) | |
tree | d911c05dd77d4c57c0c11f87c48f9e5c018c196b /plugin/forward/setup.go | |
parent | 69473c5cad654f4b3a65aab4a7d1cc35ea5d5fa6 (diff) | |
download | coredns-041e1eabc6022cba5e59a8b99d4226dea2bc4b0a.tar.gz coredns-041e1eabc6022cba5e59a8b99d4226dea2bc4b0a.tar.zst coredns-041e1eabc6022cba5e59a8b99d4226dea2bc4b0a.zip |
Fix a couple of code scanning alerts (#5157)
This PR fixed a couple of code scanning alerts:
Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
Diffstat (limited to 'plugin/forward/setup.go')
-rw-r--r-- | plugin/forward/setup.go | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/plugin/forward/setup.go b/plugin/forward/setup.go index 1f88daba5..8bd1e1ff4 100644 --- a/plugin/forward/setup.go +++ b/plugin/forward/setup.go @@ -163,13 +163,10 @@ func parseBlock(c *caddy.Controller, f *Forward) error { if !c.NextArg() { return c.ArgErr() } - n, err := strconv.Atoi(c.Val()) + n, err := strconv.ParseUint(c.Val(), 10, 32) if err != nil { return err } - if n < 0 { - return fmt.Errorf("max_fails can't be negative: %d", n) - } f.maxfails = uint32(n) case "health_check": if !c.NextArg() { |