mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #15930 from nmeum/pr/uri_parser_scheme
uri_parser: check if uri is long enough to even contain a ://
This commit is contained in:
commit
07f1254d85
@ -55,7 +55,7 @@ static char *_consume_scheme(uri_parser_result_t *result, char *uri,
|
||||
result->scheme_len = p - uri;
|
||||
|
||||
/* check if authority part exists '://' */
|
||||
if ((p[1] != '\0') && (p[2] != '\0') && (p[1] == '/') && (p[2] == '/')) {
|
||||
if (((uri_end - p) > 2) && (p[1] == '/') && (p[2] == '/')) {
|
||||
*has_authority = true;
|
||||
/* skip '://' */
|
||||
return p + 3;
|
||||
|
@ -401,6 +401,17 @@ static const validate_t validate_uris[] = {
|
||||
"./this:that",
|
||||
"",
|
||||
0),
|
||||
VEC("pP://",
|
||||
true,
|
||||
"pP",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
"",
|
||||
0),
|
||||
};
|
||||
|
||||
static char _failure_msg[VEC_MSG_LEN];
|
||||
|
Loading…
Reference in New Issue
Block a user