From 2c691d012d361be43cc2dfaf86a1b9dbb54257cc Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Mon, 21 Mar 2022 15:00:30 +0100 Subject: [PATCH] downstream: reject negative or zero network IDs in parseBouncerNetID --- downstream.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/downstream.go b/downstream.go index ec0bbfc..991fadc 100644 --- a/downstream.go +++ b/downstream.go @@ -91,7 +91,7 @@ func newInvalidUsernameOrPasswordError(err error) error { func parseBouncerNetID(subcommand, s string) (int64, error) { id, err := strconv.ParseInt(s, 10, 64) - if err != nil { + if err != nil || id <= 0 { return 0, ircError{&irc.Message{ Command: "FAIL", Params: []string{"BOUNCER", "INVALID_NETID", subcommand, s, "Invalid network ID"},