Skip to content

.pathHead is NULL after parsing http:/ #8

@erwee

Description

@erwee

On versions 8.4.0 and 8.5.0, the following code will fail on the second assert:

    const char* url = "http:/";
    UriParserStateA state;
    UriUriA uriStruct;
    state.uri = &uriStruct;
    int err = uriParseUriA(&state, url);
    assert(err == URI_SUCCESS);
    assert(uriStruct.pathHead != NULL); // this fails

I'm expecting the pathHead to be non-null, because the input string matches the (scheme ":" path-absolute) form of the URI grammar. Also, I'm expecting the first path-segment to be an empty string.

If I changed the input string to "http:/path", or to "http:///", the above test passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidThis doesn't seem right

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions