aboutsummaryrefslogtreecommitdiff
path: root/scripts/cpp
diff options
context:
space:
mode:
authorNikita Popov <npv1310@gmail.com>2021-11-02 13:21:42 +0500
committerFlorian Weimer <fweimer@redhat.com>2021-11-04 21:28:43 +0100
commitf411207a833d0c49578ebe7062aee3660813ed5f (patch)
treed02732e90058177324b02199741aa5eb98990ee2 /scripts/cpp
parent6548a9bdba95b3e1fcdbd85445342467e4b0cd4f (diff)
downloadglibc-f411207a833d0c49578ebe7062aee3660813ed5f.tar.xz
glibc-f411207a833d0c49578ebe7062aee3660813ed5f.zip
gconv: Do not emit spurious NUL character in ISO-2022-JP-3 (bug 28524)
Bugfix 27256 has introduced another issue: In conversion from ISO-2022-JP-3 encoding, it is possible to force iconv to emit extra NUL character on internal state reset. To do this, it is sufficient to feed iconv with escape sequence which switches active character set. The simplified check 'data->__statep->__count != ASCII_set' introduced by the aforementioned bugfix picks that case and behaves as if '\0' character has been queued thus emitting it. To eliminate this issue, these steps are taken: * Restore original condition '(data->__statep->__count & ~7) != ASCII_set'. It is necessary since bits 0-2 may contain number of buffered input characters. * Check that queued character is not NUL. Similar step is taken for main conversion loop. Bundled test case follows following logic: * Try to convert ISO-2022-JP-3 escape sequence switching active character set * Reset internal state by providing NULL as input buffer * Ensure that nothing has been converted. Signed-off-by: Nikita Popov <npv1310@gmail.com> (cherry picked from commit ff012870b2c02a62598c04daa1e54632e020fd7d)
Diffstat (limited to 'scripts/cpp')
0 files changed, 0 insertions, 0 deletions