]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
check that port is in valid range
authorLukáš Karas <lukas.karas@centrum.cz>
Sat, 14 Nov 2020 19:20:09 +0000 (20:20 +0100)
committerLukáš Karas <lukas.karas@centrum.cz>
Sat, 14 Nov 2020 19:20:40 +0000 (20:20 +0100)
Signed-off-by: Lukas Karas <lukas.karas@centrum.cz>
http.c

diff --git a/http.c b/http.c
index c3b84d6318e5f045fadb3f67bce286c0cc9a2218..17da01baf2351d6e396a475929aea971996c4f43 100644 (file)
--- a/http.c
+++ b/http.c
@@ -764,6 +764,8 @@ int internal_parse_url(const char *url, char **res_proto, char **res_host,
                if (!*end) {
                        *port_str = 0;
                        port = new_port;
+                       if (port <= 0 || port > 0xffff)
+                               return -EINVAL;
                }
        }