[v2,1/2] iconvdata: JISX0213 decoding lacks pending character reset (CVE-2026-77117)

Message ID 786cdc01ff46194a1cc464aa23f80075a9a31c65.1787315777.git.fweimer@redhat.com (mailing list archive)
State Under Review
Delegated to: Carlos O'Donell
Headers
Series [v2,1/2] iconvdata: JISX0213 decoding lacks pending character reset (CVE-2026-77117) |

Commit Message

Florian Weimer Aug. 21, 2026, 12:37 p.m. UTC
  This fixes bug 34556.
---
v2: Also fix the EUC bug (which was not mentioned in the AISLE report).
 iconvdata/euc-jisx0213.c   | 3 +++
 iconvdata/shift_jisx0213.c | 3 +++
 2 files changed, 6 insertions(+)


base-commit: 6467136459cc86a4426e35ac8d8f9de4673b9f1f
  

Patch

diff --git a/iconvdata/euc-jisx0213.c b/iconvdata/euc-jisx0213.c
index 5572bbdb7b..61c22231e1 100644
--- a/iconvdata/euc-jisx0213.c
+++ b/iconvdata/euc-jisx0213.c
@@ -224,6 +224,9 @@ 
 	    STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
 	  }								      \
       }									      \
+    else 								      \
+      /* There was a pending character.  Clear it.  */			      \
+      *statep = 0;							      \
 									      \
     put32 (outptr, ch);							      \
     outptr += 4;							      \
diff --git a/iconvdata/shift_jisx0213.c b/iconvdata/shift_jisx0213.c
index 61c9c3ce6d..e9179f605e 100644
--- a/iconvdata/shift_jisx0213.c
+++ b/iconvdata/shift_jisx0213.c
@@ -226,6 +226,9 @@ 
 	    STANDARD_FROM_LOOP_ERR_HANDLER (1);				      \
 	  }								      \
       }									      \
+    else 								      \
+      /* There was a pending character.  Clear it.  */			      \
+      *statep = 0;							      \
 									      \
     put32 (outptr, ch);							      \
     outptr += 4;							      \