[PATCH] iconv: Fix incorrect UCS4 inner loop bounds (BZ#26923)

Michael Colavita mcolavita@fb.com
Thu Nov 19 18:40:37 GMT 2020

Previously, in UCS4 conversion routines we limit the number of
characters we examine to the minimum of the number of characters in the
input and the number of characters in the output. This is not the
correct behavior when __GCONV_IGNORE_ERRORS is set, as we do not consume
an output character when we skip a code unit. Instead, track the input
and output pointers and terminate the loop when either reaches its

This resolves assertion failures when resetting the input buffer in a step of
iconv, which assumes that the input will be fully consumed given sufficient
output space.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-iconv-Fix-incorrect-UCS4-inner-loop-bounds-BZ-26923.patch
Type: application/octet-stream
Size: 5315 bytes
Desc: 0001-iconv-Fix-incorrect-UCS4-inner-loop-bounds-BZ-26923.patch
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20201119/8aac5005/attachment.obj>

More information about the Libc-alpha mailing list