From 539e559e65cd8f227c45e4b046ac41c0edcf6c32 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sat, 31 Dec 2022 13:55:11 -0800 Subject: Fixes for some security complaints. None of these changes are actual security bugs, but GitHub's scanner reports false positives at Critical severity for them. (There are a number of complaints from that scanner, many of which we do not necessarily agree with.) --- tests/httpserver.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/httpserver.c') diff --git a/tests/httpserver.c b/tests/httpserver.c index f7a28b5d..c593fc81 100644 --- a/tests/httpserver.c +++ b/tests/httpserver.c @@ -1,5 +1,5 @@ // -// Copyright 2021 Staysail Systems, Inc. +// Copyright 2022 Staysail Systems, Inc. // Copyright 2018 Capitar IT Group BV // Copyright 2020 Dirac Research // @@ -191,7 +191,7 @@ TestMain("HTTP Server", { char urlstr[48]; nng_url *url; - trantest_next_address(portbuf, "%u"); + trantest_next_address(portbuf, ""); snprintf( urlstr, sizeof(urlstr), "http://127.0.0.1:%s", portbuf); @@ -295,7 +295,7 @@ TestMain("HTTP Server", { char * subdir1; char * subdir2; - trantest_next_address(urlstr, "http://127.0.0.1:%u"); + trantest_next_address(urlstr, "http://127.0.0.1:"); So(nng_url_parse(&url, urlstr) == 0); So(nng_http_server_hold(&s, url) == 0); So((tmpdir = nni_plat_temp_dir()) != NULL); @@ -497,7 +497,7 @@ TestMain("HTTP Server", { char * subdir1; char * subdir2; - trantest_next_address(urlstr, "http://127.0.0.1:%u"); + trantest_next_address(urlstr, "http://127.0.0.1:"); So(nng_url_parse(&url, urlstr) == 0); So(nng_http_server_hold(&s, url) == 0); So((tmpdir = nni_plat_temp_dir()) != NULL); @@ -698,7 +698,7 @@ TestMain("HTTP Server", { char * file1; char * file2; - trantest_next_address(urlstr, "http://127.0.0.1:%u"); + trantest_next_address(urlstr, "http://127.0.0.1:"); So(nng_url_parse(&url, urlstr) == 0); So(nng_http_server_hold(&s, url) == 0); So((tmpdir = nni_plat_temp_dir()) != NULL); @@ -788,7 +788,7 @@ TestMain("HTTP Server", { char urlstr[32]; nng_url *url; - trantest_next_address(urlstr, "http://127.0.0.1:%u"); + trantest_next_address(urlstr, "http://127.0.0.1:"); So(nng_url_parse(&url, urlstr) == 0); So(nng_http_server_hold(&s, url) == 0); @@ -859,7 +859,7 @@ TestMain("HTTP Server", { char urlstr[32]; nng_url *url; - trantest_next_address(urlstr, "http://127.0.0.1:%u"); + trantest_next_address(urlstr, "http://127.0.0.1:"); So(nng_url_parse(&url, urlstr) == 0); So(nng_http_server_hold(&s, url) == 0); @@ -978,7 +978,7 @@ TestMain("HTTP Server", { char urlstr[32]; nng_url *url; - trantest_next_address(urlstr, "http://127.0.0.1:%u"); + trantest_next_address(urlstr, "http://127.0.0.1:"); So(nng_url_parse(&url, urlstr) == 0); So(nng_http_server_hold(&s, url) == 0); -- cgit v1.2.3-70-g09d2