iconv: fix missing bounds checking for shift_jis decoding
commit7ada6dde6f9dc6a2836c3d92c2f762d35fd229e0
authorRich Felker <dalias@aerifal.cx>
Sat, 2 Mar 2024 20:01:18 +0000 (2 15:01 -0500)
committerRich Felker <dalias@aerifal.cx>
Sun, 3 Mar 2024 03:17:49 +0000 (2 22:17 -0500)
treea9fb539bb6553839248f8bce59ecea0a3e3a2b38
parentfd7d018521115f2674bf85cbccaf745852b9ed3a
iconv: fix missing bounds checking for shift_jis decoding

the jis0208 table we use is only 84x94 in size, but the shift_jis
encoding supports a 94x94 grid. attempts to convert sequences outside
of the supported zone resulted in out-of-bounds table reads,
misinterpreting adjacent rodata as part of the character table and
thereby converting these sequences to unexpected characters.
src/locale/iconv.c