mirror of
https://sourceware.org/git/glibc.git
synced 2025-11-30 11:41:39 +03:00
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:
@@ -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; \
|
||||||
|
|||||||
Reference in New Issue
Block a user