mirror of
https://github.com/ipxe/ipxe
synced 2026-05-08 15:02:55 +03:00
[uri] Ensure "##params=" separator is correct
Signed-off-by: Christian Nilsson <nikize@gmail.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
committed by
Michael Brown
parent
59c67e1110
commit
30d162ddd1
+2
-1
@@ -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 {
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user