From eacbe261d48979f72585225107d00bba76623e8e Mon Sep 17 00:00:00 2001 From: Pavel Grunt Date: Wed, 1 Jun 2016 10:04:47 +0200 Subject: spice-uri: Check if port is in allowed range Use g_ascii_strtoll because it helps to detect overflow. Related: rhbz#1335239 Acked-by: Victor Toso --- tests/uri.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/uri.c b/tests/uri.c index ee3d061..34569ec 100644 --- a/tests/uri.c +++ b/tests/uri.c @@ -76,6 +76,9 @@ static void test_spice_uri_ipv4_bad(void) {"http://127.0.0.1:port", "http", "127.0.0.1", 3128, NULL, NULL, "Invalid uri port: port"}, {"http://127.0.0.1:", "http", "127.0.0.1", 3128, NULL, NULL, "Missing uri port"}, + {"http://127.0.0.1:-80", "http", "127.0.0.1", 3128, NULL, NULL, "Port out of range"}, + {"http://127.0.0.1:4294967396", "http", "127.0.0.1", 3128, NULL, NULL, "Port out of range"}, + {"http://127.0.0.1:12345678901234", "http", "127.0.0.1", 3128, NULL, NULL, "Port out of range"}, }; test_spice_uri_bad(invalid_test_cases, G_N_ELEMENTS(invalid_test_cases)); -- cgit v1.2.3