Re: [PATCH 1/2] iconvdata: SHIFT_JISX0213 lacks pending character reset (CVE-2026-77117)
Florian Weimer <[email protected]>
| Newsgroups | gmane.comp.lib.glibc.alpha |
|---|---|
| Message-ID | <[email protected]> |
* Carlos O'Donell: > There is another bug present here that results in data loss and should > probably get it's own bug filed... > > What happens if the combining character is the last character? > > In such a case loop.c skips calling BODY (because there is no input to > consume) in that case and returns a success but drops the combining > character even if there is room, and this leads to a data loss scenario? As implemented, SHIFT_JISX0213 has shift states due to this pending character handling. This means that applications need to flush the state to drain any pending characters. I don't think there is a bug. At the iconv level, where inputs and outputs are opaque byte streams, SHIFT_JISX0213 could be implemented with shift states. But this would preclude use of SHIFT_JISX0213 as a locale character set because the C interfaces assume that one input character can produce at most one output character, and glibc (and other implementations) use shift states to work around that to some extent. So I think there is no data loss bug here. Thanks, Florian