1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-10 08:58:16 +03:00

Limit recursion depth in xmlXPathCompOpEvalPredicate

This commit is contained in:
Nick Wellnhofer 2019-05-08 12:00:51 +02:00
parent ad93f087d1
commit 14ed63b7d0

View File

@ -11833,8 +11833,12 @@ xmlXPathCompOpEvalPredicate(xmlXPathParserContextPtr ctxt,
"xmlXPathCompOpEvalPredicate: Expected a predicate\n");
XP_ERROR(XPATH_INVALID_OPERAND);
}
if (ctxt->context->depth >= ctxt->context->maxDepth)
XP_ERROR(XPATH_RECURSION_LIMIT_EXCEEDED);
ctxt->context->depth += 1;
xmlXPathCompOpEvalPredicate(ctxt, &comp->steps[op->ch1], set,
1, set->nodeNr, hasNsNodes);
ctxt->context->depth -= 1;
CHECK_ERROR;
}