diff --git a/xmlstring.c b/xmlstring.c index 6a598c611..9dd5a8743 100644 --- a/xmlstring.c +++ b/xmlstring.c @@ -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); }