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

Fix undefined behavior in xmlRegExecPushStringInternal

It's stupid, but the behavior of memcpy(NULL, NULL, 0) is undefined.
This commit is contained in:
Nick Wellnhofer 2017-05-31 16:48:27 +02:00
parent 474967241c
commit 34e445674d

View File

@ -4089,6 +4089,7 @@ rollback:
xmlFree(exec->errString);
exec->errString = xmlStrdup(value);
exec->errState = exec->state;
if (exec->comp->nbCounters)
memcpy(exec->errCounts, exec->counts,
exec->comp->nbCounters * sizeof(int));
}