From: Christian Nilsson Date: Tue, 3 Feb 2026 18:59:01 +0000 (+0000) Subject: [uri] Ensure "##params=" separator is correct X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F448%2Fhead;p=thirdparty%2Fipxe.git [uri] Ensure "##params=" separator is correct Signed-off-by: Christian Nilsson Modified-by: Michael Brown Signed-off-by: Michael Brown --- diff --git a/src/core/uri.c b/src/core/uri.c index 9da5e298b..ea0f2bc45 100644 --- a/src/core/uri.c +++ b/src/core/uri.c @@ -321,7 +321,8 @@ struct uri * parse_uri ( const char *uri_string ) { if ( ( tmp = strstr ( raw, "##params" ) ) ) { *tmp = '\0'; tmp += 8 /* "##params" */; - params = find_parameters ( *tmp ? ( tmp + 1 ) : NULL ); + params = find_parameters ( ( *tmp == '=' ) ? + ( tmp + 1 ) : NULL ); if ( params ) { uri->params = claim_parameters ( params ); } else { diff --git a/src/tests/uri_test.c b/src/tests/uri_test.c index 7ce87a208..fa46e22f2 100644 --- a/src/tests/uri_test.c +++ b/src/tests/uri_test.c @@ -967,6 +967,19 @@ static struct uri_params_test uri_named_params = { uri_named_params_list, }; +/** Invalid named form parameter URI test */ +static struct uri_params_test uri_invalid_named_params = { + "http://boot.ipxe.org/register##paramsXfoo", + { + .scheme = "http", + .host = "boot.ipxe.org", + .path = "/register", + .epath = "/register", + }, + NULL, + uri_named_params_list, +}; + /** * Perform URI self-test * @@ -1026,6 +1039,7 @@ static void uri_test_exec ( void ) { /* Request parameter URI tests */ uri_params_ok ( &uri_params ); uri_params_ok ( &uri_named_params ); + uri_params_ok ( &uri_invalid_named_params ); } /** URI self-test */