Files
poky/meta/recipes-core/expat/expat/CVE-2026-56405.patch
Deepak Rathore 8859330d24 expat: fix CVE-2026-56405
This patch applies the upstream fix shown in [1] as referenced by [2].

[1] 2c6c42d336
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-56405

(From OE-Core rev: 7d9b2576a9dcb01184c0aa3bd54a6bdd20496bbe)

Signed-off-by: Deepak Rathore <deeratho@cisco.com>
Signed-off-by: Fabien Thomas <fabien.thomas@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
2026-08-24 11:43:44 +01:00

31 lines
1.1 KiB
Diff

From 49ba5bdafa7aaee9b77a32ffaa798e625bd46e73 Mon Sep 17 00:00:00 2001
From: netliomax25-code <netliomax25@gmail.com>
Date: Fri, 29 May 2026 11:45:17 +0530
Subject: [PATCH 05/17] lib: Protect function getAttributeId from signed
integer overflow
CVE: CVE-2026-56405
Upstream-Status: Backport [https://github.com/libexpat/libexpat/commit/2c6c42d33689f6b266a5267b639e03cde17e53c0]
(cherry picked from commit 2c6c42d33689f6b266a5267b639e03cde17e53c0)
Signed-off-by: Deepak Rathore <deeratho@cisco.com>
---
expat/lib/xmlparse.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
index 9d21e136..80ad0811 100644
--- a/expat/lib/xmlparse.c
+++ b/expat/lib/xmlparse.c
@@ -7312,6 +7312,10 @@ getAttributeId(XML_Parser parser, const ENCODING *enc, const char *start,
} else {
int i;
for (i = 0; name[i]; i++) {
+ /* Detect and prevent signed integer overflow */
+ if (i == INT_MAX) {
+ return NULL;
+ }
/* attributes without prefix are *not* in the default namespace */
if (name[i] == XML_T(ASCII_COLON)) {
int j;