mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
iconv: fix erroneous decoding of some invalid ShiftJIS sequences
out-of-range second bytes were not handled, leading to wrong character output rather than a reported encoding error. fix based on bug report by Nick Wellnhofer, submitted in private in case the issue turned out to have security implications.
This commit is contained in:
parent
6af4f25b89
commit
5e594aeabf
1 changed files with 2 additions and 0 deletions
|
@ -339,6 +339,8 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
|
|||
} else if (d-159 <= 252-159) {
|
||||
c++;
|
||||
d -= 159;
|
||||
} else {
|
||||
goto ilseq;
|
||||
}
|
||||
if (c>=84) goto ilseq;
|
||||
c = jis0208[c][d];
|
||||
|
|
Loading…
Add table
Reference in a new issue