diff --git a/xmlschemas.c b/xmlschemas.c index b9c61b82..d276faf1 100644 --- a/xmlschemas.c +++ b/xmlschemas.c @@ -22744,7 +22744,7 @@ xmlSchemaXPathProcessHistory(xmlSchemaValidCtxtPtr vctxt, } else if (pos >= matcher->sizeKeySeqs) { int i = matcher->sizeKeySeqs; - matcher->sizeKeySeqs *= 2; + matcher->sizeKeySeqs = pos * 2; matcher->keySeqs = (xmlSchemaPSVIIDCKeyPtr **) xmlRealloc(matcher->keySeqs, matcher->sizeKeySeqs *