1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

uri_parser: do not parse path if end-of-uri

This commit is contained in:
Cenk Gündoğan 2021-02-04 16:19:29 +01:00
parent 1040cf9862
commit 6f13325a52
No known key found for this signature in database
GPG Key ID: A3DBC2F744D484D2

View File

@ -231,8 +231,12 @@ static int _parse_absolute(uri_parser_result_t *result, char *uri,
}
}
/* parsing the path, starting with '/' */
return _parse_relative(result, uri, uri_end);
/* is there more to parse after authority? */
if (uri < uri_end) {
/* parsing the path, starting with '/' */
return _parse_relative(result, uri, uri_end);
}
return 0;
}
bool uri_parser_is_absolute(const char *uri, size_t uri_len)