Skip to content
This repository was archived by the owner on Nov 6, 2022. It is now read-only.
This repository was archived by the owner on Nov 6, 2022. It is now read-only.

parser->nread is incorrect at on_headers_complete #451

Open
@jcwcmimik

Description

@jcwcmimik

master branch as of commit 4dae120, http_parser.c:1788

Neither SET_ERRNO nor RETURN are necessarily called in this case (s_headers_almost_done) and thus when on_headers_complete(parser) is called, parser still contains an old nread value (0 if it's the first parse attempt).

In my test cases, inserting parser->nread = nread; just before line 1788 solves the issue, but based on that assignment being contained solely within the SET_ERRNO and RETURN defines, someone more familiary with the code may wish to implement it elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions