You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[C++][Gandiva] Out-of-bounds read in mask functions from wrong utf8proc_iterate length #50707
The Gandiva mask stubs walk a utf8 string with utf8proc_iterate, but pass the total data_len as the remaining-byte count instead of data_len - bytes_read even though the pointer has already advanced:
gdv_mask_first_n_utf8_int32
gdv_mask_last_n_utf8_int32
mask_utf8_utf8_utf8_utf8
utf8proc_iterate(str, strlen, ...) reads up to strlen bytes from str. With str = data + bytes_read and strlen = data_len, a truncated trailing multi-byte glyph (for example a lead byte 0xF0 as the final byte of an exactly-sized value buffer) makes utf8proc read continuation bytes past data + data_len.
This is reachable from mask() / mask_first_n() / mask_last_n() on untrusted string data whose value buffer is exactly sized. Passing the true remaining length lets utf8proc report the truncated glyph instead of over-reading.
Activity
apacheGH-50707: [C++][Gandiva] fix out-of-bounds read in mask utf8pro…
apacheGH-50707: check char_len for invalid utf8 in gdv_mask_last_n_ut…
GH-50707: [C++][Gandiva] fix out-of-bounds read in mask utf8proc leng…
raulcd commentedon Aug 14, 2026
Issue resolved by pull request 50709
#50709