1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-12-27 03:21:26 +03:00

Remove redundant size check

The condition size > UINT_MAX - 10 is already checked earlier, so the
check is always false.
This commit is contained in:
Niels Dossche 2023-11-02 13:57:54 +01:00 committed by Nick Wellnhofer
parent fbea03f3d0
commit 6053f1ff54

6
tree.c
View File

@ -7348,7 +7348,7 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
case XML_BUFFER_ALLOC_DOUBLEIT:
/*take care of empty case*/
if (buf->size == 0)
newSize = (size > UINT_MAX - 10 ? UINT_MAX : size + 10);
newSize = size + 10;
else
newSize = buf->size;
while (size > newSize) {
@ -7358,7 +7358,7 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
}
break;
case XML_BUFFER_ALLOC_EXACT:
newSize = (size > UINT_MAX - 10 ? UINT_MAX : size + 10);
newSize = size + 10;
break;
case XML_BUFFER_ALLOC_HYBRID:
if (buf->use < BASE_BUFFER_SIZE)
@ -7374,7 +7374,7 @@ xmlBufferResize(xmlBufferPtr buf, unsigned int size)
break;
default:
newSize = (size > UINT_MAX - 10 ? UINT_MAX : size + 10);
newSize = size + 10;
break;
}