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

Merge pull request #13777 from cgundogan/pr/uri_parser/pointer_deref

sys/uri_parser: initialize has_authority in _consume_scheme()
This commit is contained in:
Cenk Gündoğan 2020-04-01 13:06:33 +02:00 committed by GitHub
commit 7eaf6b37a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,9 @@ static char *_consume_scheme(uri_parser_result_t *result, char *uri,
char *uri_end, bool *has_authority) char *uri_end, bool *has_authority)
{ {
assert(uri); assert(uri);
assert(!has_authority);
/* assume no authority section first */
*has_authority = false;
/* cannot have empty scheme */ /* cannot have empty scheme */
if (uri[0] == ':') { if (uri[0] == ':') {
@ -186,7 +188,7 @@ static int _parse_relative(uri_parser_result_t *result, char *uri,
static int _parse_absolute(uri_parser_result_t *result, char *uri, static int _parse_absolute(uri_parser_result_t *result, char *uri,
char *uri_end) char *uri_end)
{ {
bool has_authority = false; bool has_authority;
uri = _consume_scheme(result, uri, uri_end, &has_authority); uri = _consume_scheme(result, uri, uri_end, &has_authority);
if (uri == NULL) { if (uri == NULL) {