Add a test case for OSSL_HTTP_parse_url
authorMatt Caswell <matt@openssl.org>
Wed, 6 Dec 2023 12:51:34 +0000 (12:51 +0000)
committerMatt Caswell <matt@openssl.org>
Tue, 12 Dec 2023 16:13:01 +0000 (16:13 +0000)
Ensure we test the case where the port value is empty in the URL.

Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/22961)

(cherry picked from commit a36d10dfb7e77614c8d3da602ff3800a2e9f4989)

test/http_test.c

index b9f7452744cb92bb6f4f1f82527dfd1ff2d0dcd9..b6897a17fdd8e25e967061e48afb21f2b8599b18 100644 (file)
@@ -298,7 +298,8 @@ static int test_http_url_invalid_prefix(void)
 
 static int test_http_url_invalid_port(void)
 {
-    return test_http_url_invalid("https://1.2.3.4:65536/pkix");
+    return test_http_url_invalid("https://1.2.3.4:65536/pkix")
+           && test_http_url_invalid("https://1.2.3.4:");
 }
 
 static int test_http_url_invalid_path(void)