Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pluknet
Copy link
Contributor

@pluknet pluknet commented Nov 14, 2025

Empty request body buffering is specially handled to avoid extra write+seek syscalls as initially introduced in 4c7f511 (0.4.4). This was later broken in chunked body filter in 5fc8543 (1.3.9) where rb->bufs cannot be NULL as it holds at least the final chunk, and further regressed in length body filter in 2a70921 (1.21.2) where rb->bufs started to indicate the last buffer received.

The fix is to additionally check if it is the only empty buffer.

Found with UndefinedBehaviorSanitizer (pointer-overflow)

Empty request body buffering is specially handled to avoid extra
write+seek syscalls as initially introduced in 4c7f511 (0.4.4).
This was later broken in chunked body filter in 5fc8543 (1.3.9)
where rb->bufs cannot be NULL as it holds at least the final chunk,
and further regressed in length body filter in 2a70921 (1.21.2)
where rb->bufs started to indicate the last buffer received.

The fix is to additionally check if it is the only empty buffer.

Found with UndefinedBehaviorSanitizer (pointer-overflow)
@pluknet pluknet requested a review from arut November 14, 2025 13:57
@pluknet pluknet self-assigned this Nov 14, 2025
@pluknet pluknet added the bug label Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant