libxml2/backport-hash-Fix-integer-overflow-of-nbElems.patch
2024-05-06 16:53:04 +08:00

36 lines
1.0 KiB
Diff

From 4b8f7cf05def7192928c6a023300ee55ef2a9cfe Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Fri, 1 Sep 2023 13:07:27 +0200
Subject: [PATCH] hash: Fix integer overflow of nbElems
Reference:https://github.com/GNOME/libxml2/commit/4b8f7cf05def7192928c6a023300ee55ef2a9cfe
Conflict:NA
---
hash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hash.c b/hash.c
index cbcc4293..45635857 100644
--- a/hash.c
+++ b/hash.c
@@ -541,7 +541,7 @@ xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name,
xmlHashEntryPtr entry;
xmlHashEntryPtr insert;
- if ((table == NULL) || (name == NULL))
+ if ((table == NULL) || (name == NULL) || (table->nbElems == INT_MAX))
return(-1);
/*
@@ -680,7 +680,7 @@ xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name,
xmlHashEntryPtr entry;
xmlHashEntryPtr insert;
- if ((table == NULL) || name == NULL)
+ if ((table == NULL) || (name == NULL) || (table->nbElems == INT_MAX))
return(-1);
/*
--
2.23.0