summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPavel Grunt <pgrunt@redhat.com>2016-06-01 10:04:47 +0200
committerPavel Grunt <pgrunt@redhat.com>2016-06-02 10:26:10 +0200
commiteacbe261d48979f72585225107d00bba76623e8e (patch)
treeb1d3ae8cf7b898369a9fcb312bb28efe0ab37c60 /tests
parent85051b06c1f04b206c00bb7f674a9a29bfb19594 (diff)
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 <victortoso@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/uri.c3
1 files changed, 3 insertions, 0 deletions
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));