Skip to content

cpool: make bundle->dest an array; fix UB#18850

Closed
MegaManSec wants to merge 2 commits into
curl:masterfrom
MegaManSec:ub
Closed

cpool: make bundle->dest an array; fix UB#18850
MegaManSec wants to merge 2 commits into
curl:masterfrom
MegaManSec:ub

Conversation

@MegaManSec
Copy link
Copy Markdown
Contributor

Replace char *dest[1] with a proper char dest[1] array in cpool_bundle. This removes undefined behavior from memcpy (writing past the declared object) while keeping the same key semantics: dest_len is strlen+1 (includes NUL), and hash add/delete calls remain unchanged.

also fixes a tiny typo in this code.

Replace `char *dest[1]` with a proper `char dest[1]` array in
cpool_bundle. This removes undefined behavior from memcpy (writing past the
declared object) while keeping the same key semantics: dest_len is strlen+1
(includes NUL), and hash add/delete calls remain unchanged.
@bagder bagder closed this in c0febf6 Oct 5, 2025
@bagder
Copy link
Copy Markdown
Member

bagder commented Oct 5, 2025

Thanks!

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

Development

Successfully merging this pull request may close these issues.

2 participants