Fix undefined behavior in xmlRegExecPushStringInternal
It's stupid, but the behavior of memcpy(NULL, NULL, 0) is undefined.
diff --git a/xmlregexp.c b/xmlregexp.c
index ca3b4f4..7dc6eea 100644
--- a/xmlregexp.c
+++ b/xmlregexp.c
@@ -4089,8 +4089,9 @@
xmlFree(exec->errString);
exec->errString = xmlStrdup(value);
exec->errState = exec->state;
- memcpy(exec->errCounts, exec->counts,
- exec->comp->nbCounters * sizeof(int));
+ if (exec->comp->nbCounters)
+ memcpy(exec->errCounts, exec->counts,
+ exec->comp->nbCounters * sizeof(int));
}
/*