Skip to content

bufq: add integer overflow checks before chunk allocations#18112

Closed
coleleavitt wants to merge 3 commits intocurl:masterfrom
coleleavitt:master
Closed

bufq: add integer overflow checks before chunk allocations#18112
coleleavitt wants to merge 3 commits intocurl:masterfrom
coleleavitt:master

Conversation

@coleleavitt
Copy link
Contributor

Add defensive int overflow checking in the buffer queue allocation functions to prevent potential heap buffer overflows if large chunk sizes are ever used.

The calculation sizeof(*chunk) + q->chunk_size has the potential to overflow if chunk_size is near SIZE_MAX which results in a smaller allocation than intended.

Through testing this is not an exploitable vulnerability in release.

Copy link
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

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

SIZE_MAX is a very large limit but I suppose the check is still sensible!

@bagder
Copy link
Member

bagder commented Jul 31, 2025

This will be easier if you stop merging in unrelated things.

@bagder bagder closed this in 4108d11 Jul 31, 2025
@bagder
Copy link
Member

bagder commented Jul 31, 2025

Thanks!

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments