1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-26 14:50:08 +03:00

hash: Fix integer overflow of nbElems

This commit is contained in:
Nick Wellnhofer 2023-09-01 13:07:27 +02:00
parent bfd7d28698
commit 4b8f7cf05d

4
hash.c
View File

@ -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);
/*