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:
committed by
Daniel Garcia Moreno
parent
c6167cf3b9
commit
68f91d1893
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user