Skip to content

[#710] Fix split CRLF handling in http_read_chunked_body - #712

Open
Mohamed-Alkafory wants to merge 1 commit into
pgexporter:mainfrom
Mohamed-Alkafory:fix/chunked-crlf
Open

Mohamed-Alkafory wants to merge 1 commit into
pgexporter:mainfrom
Mohamed-Alkafory:fix/chunked-crlf

Conversation

@Mohamed-Alkafory

Copy link
Copy Markdown
Contributor

Closes #710

@Pranav-error

Copy link
Copy Markdown
Collaborator

#692 is merged now. It fixes the Debug crash in test_connection_bind_unix_socket_permissions (#691), which is what fails both build-linux Debug jobs here. Please rebase on main.

@Pranav-error Pranav-error left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked on macOS, Debug build with ASan. test_http_chunked_split_crlf fails on 801d41c (10/10) and passes on e7f1c43 (20/20). A local harness that splits the body at every offset (2-piece, 3-piece, one byte per send) over 4 bodies (single, multi-chunk, chunk extension, trailer): 27 failures on main, 0 with this PR. Format is clean.

One gap: no test reaches the EOF branch in http_read_chunked_trailing(). If I change != 1 to < 0, or drop the goto error after the last-chunk read, the PR test still passes. Can you add an MCTF_TEST_NEGATIVE case where the server closes right after 5\r\nHello\r\n0\r\n and the test expects PGEXPORTER_HTTP_STATUS_ERROR?

Not run: Linux, TLS path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http_read_chunked_body fails when a chunk's trailing CRLF is split across reads

2 participants