1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-28 23:44:09 +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:
Florian Weimer
2025-11-28 11:46:09 +01:00
parent e535fb910c
commit e98bd0c54d

View File

@@ -407,7 +407,7 @@ static const char from_ucs4[][2] =
is also available. */ \
uint32_t ch2; \
\
if (inptr + 1 >= inend) \
if (inend - inptr <= 1) \
{ \
/* The second character is not available. */ \
result = __GCONV_INCOMPLETE_INPUT; \