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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user