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:
parent
ad93f087d1
commit
14ed63b7d0
4
xpath.c
4
xpath.c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user