From d6294856324abaab9e132d20fbfa1e8413027230 Mon Sep 17 00:00:00 2001 From: Patsy Griffin Date: Tue, 25 Nov 2025 16:23:25 -0500 Subject: [PATCH] Move ANSI_X3.110-1983 support from main package to glibc-gconv-extra. Include iconvdata: fix invalid pointer arithmetic in ANSI_X3.110 module. (RHEL-41205) Resolves: RHEL-41205 --- glibc-RHEL-41205.patch | 24 ++++++++++++++++++++++++ glibc.spec | 3 +-- 2 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 glibc-RHEL-41205.patch diff --git a/glibc-RHEL-41205.patch b/glibc-RHEL-41205.patch new file mode 100644 index 0000000..8ed15bb --- /dev/null +++ b/glibc-RHEL-41205.patch @@ -0,0 +1,24 @@ +commit e98bd0c54d5e296ad1be91b6fe35260c6b87e733 +Author: Florian Weimer +Date: Fri Nov 28 11:46:09 2025 +0100 + + 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 + +diff --git a/iconvdata/ansi_x3.110.c b/iconvdata/ansi_x3.110.c +index c5506b13b8..94e6e6b745 100644 +--- a/iconvdata/ansi_x3.110.c ++++ b/iconvdata/ansi_x3.110.c +@@ -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; \ diff --git a/glibc.spec b/glibc.spec index bd5424d..ce4f37d 100644 --- a/glibc.spec +++ b/glibc.spec @@ -2295,8 +2295,7 @@ split_sysroot_file_list \ split_sysroot_file_list \ %{_libdir}/gconv '-name *.so' \ 'gconv/ - (ANSI_X3\.110 - |CP1252 + (CP1252 |ISO8859-15? |UNICODE |UTF-[0-9]+