mirror of git://sourceware.org/git/glibc.git
iconvdata: Fix invalid pointer arithmetic in ANSI_X3.110 module
The expression inptr + 1 can technically be invalid: if inptr == inend, inptr may point one element past the end of an array. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
e535fb910c
commit
e98bd0c54d
|
|
@ -407,7 +407,7 @@ static const char from_ucs4[][2] =
|
||||||
is also available. */ \
|
is also available. */ \
|
||||||
uint32_t ch2; \
|
uint32_t ch2; \
|
||||||
\
|
\
|
||||||
if (inptr + 1 >= inend) \
|
if (inend - inptr <= 1) \
|
||||||
{ \
|
{ \
|
||||||
/* The second character is not available. */ \
|
/* The second character is not available. */ \
|
||||||
result = __GCONV_INCOMPLETE_INPUT; \
|
result = __GCONV_INCOMPLETE_INPUT; \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue