summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/libxslt/src/libxslt/functions.c
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/libxslt/src/libxslt/functions.c')
-rw-r--r--chromium/third_party/libxslt/src/libxslt/functions.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/chromium/third_party/libxslt/src/libxslt/functions.c b/chromium/third_party/libxslt/src/libxslt/functions.c
index b350545a11b..7887dda70f6 100644
--- a/chromium/third_party/libxslt/src/libxslt/functions.c
+++ b/chromium/third_party/libxslt/src/libxslt/functions.c
@@ -178,10 +178,22 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
goto out_fragment;
}
+#if LIBXML_VERSION >= 20911 || \
+ defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
+ xptrctxt->opLimit = ctxt->context->opLimit;
+ xptrctxt->opCount = ctxt->context->opCount;
+ xptrctxt->depth = ctxt->context->depth;
+
+ resObj = xmlXPtrEval(fragment, xptrctxt);
+
+ ctxt->context->opCount = xptrctxt->opCount;
+#else
resObj = xmlXPtrEval(fragment, xptrctxt);
- xmlXPathFreeContext(xptrctxt);
#endif
+ xmlXPathFreeContext(xptrctxt);
+#endif /* LIBXML_XPTR_ENABLED */
+
if (resObj == NULL)
goto out_fragment;