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:
commit
7eaf6b37a9
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user