]> git.ipfire.org Git - thirdparty/glibc.git/commit
iconv: Fix incorrect UCS4 inner loop bounds (BZ#26923)
authorMichael Colavita <mcolavita@fb.com>
Thu, 19 Nov 2020 16:44:40 +0000 (11:44 -0500)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 7 Dec 2020 16:53:26 +0000 (22:23 +0530)
commit228edd356f03bf62dcf2b1335f25d43c602ee68d
tree85a40834d0c664df673a52adee19de6a040f7baa
parent088e9625378f25607acff3daf7a79cbdee497043
iconv: Fix incorrect UCS4 inner loop bounds (BZ#26923)

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
limit.

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.
iconv/Makefile
iconv/gconv_simple.c
iconv/tst-iconv8.c [new file with mode: 0644]