Skip to content

GH-50075: [C++][Gandiva] fix buffer overrun in to_hex int32/int64#50076

Open
metsw24-max wants to merge 1 commit into
apache:mainfrom
metsw24-max:gandiva-to-hex-buffer-overrun
Open

GH-50075: [C++][Gandiva] fix buffer overrun in to_hex int32/int64#50076
metsw24-max wants to merge 1 commit into
apache:mainfrom
metsw24-max:gandiva-to-hex-buffer-overrun

Conversation

@metsw24-max
Copy link
Copy Markdown
Contributor

@metsw24-max metsw24-max commented Jun 2, 2026

to_hex_int64/to_hex_int32 in string_ops.cc allocate the arena buffer with the bare hex-digit count (16 and 8) but pass that size + 1 to snprintf. A full-width value such as to_hex(-1::bigint) writes 16 digits plus a NUL, one byte past the allocation, corrupting the next arena allocation since gdv_fn_context_arena_malloc returns exactly the requested bytes. Allocate the extra byte, same as the GH-49752 fix in hash_utils.cc.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

⚠️ GitHub issue #50075 has been automatically assigned in GitHub to PR creator.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant