1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

xmlstring: fix access out-of-bound array if len <= 0

This commit is contained in:
Herman Semenoff
2025-12-12 07:45:09 +03:00
committed by Daniel Garcia Moreno
parent c6167cf3b9
commit 68f91d1893

View File

@@ -517,7 +517,7 @@ xmlStrPrintf(xmlChar *buf, int len, const char *msg, ...) {
va_list args;
int ret;
if((buf == NULL) || (msg == NULL)) {
if((buf == NULL) || (msg == NULL) || (len <= 0)) {
return(-1);
}
@@ -542,7 +542,7 @@ int
xmlStrVPrintf(xmlChar *buf, int len, const char *msg, va_list ap) {
int ret;
if((buf == NULL) || (msg == NULL)) {
if((buf == NULL) || (msg == NULL) || (len <= 0)) {
return(-1);
}