Skip to content

CGI POST data truncated when content length is non-zero multiple of 128 #18

@shattar

Description

@shattar

In "boost/cgi/cgi/request_service.hpp" in parse_post_vars(), the remaining bytes to read is decremented twice for a single read. Once in the client read_some, and once in the request service parst_post_vars. This is because a reference to the client bytes_left is used rather than a copy of the bytes left.

std::size_t& bytes_left (impl.client_.bytes_left_);

Should be
std::size_t bytes_left (impl.client_.bytes_left_);

For content lengths that are not multiples of 128, the double decrement rolls over and the post data is read until the eof is encountered, possibly greater than the content length.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions