-
-
Notifications
You must be signed in to change notification settings - Fork 905
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: upstream libxml2 bug in calculating xpath query recursion depth
Fixes #2257 See related https://gitlab.gnome.org/GNOME/libxml2/-/issues/264
- Loading branch information
1 parent
a48c305
commit 1f6c661
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 3e1aad4fe584747fd7d17cc7b2863a78e2d21a77 Mon Sep 17 00:00:00 2001 | ||
From: Nick Wellnhofer <wellnhofer@aevum.de> | ||
Date: Wed, 2 Jun 2021 17:31:49 +0200 | ||
Subject: [PATCH] Fix XPath recursion limit | ||
|
||
Fix accounting of recursion depth when parsing XPath expressions. | ||
|
||
This silly bug introduced in commit 804c5297 could lead to spurious | ||
errors when parsing larger expressions or XSLT documents. | ||
|
||
Should fix #264. | ||
--- | ||
xpath.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/xpath.c b/xpath.c | ||
index 7497ba0..1aa2f1a 100644 | ||
--- a/xpath.c | ||
+++ b/xpath.c | ||
@@ -10983,7 +10983,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) { | ||
} | ||
|
||
if (xpctxt != NULL) | ||
- xpctxt->depth -= 1; | ||
+ xpctxt->depth -= 10; | ||
} | ||
|
||
/** | ||
-- | ||
2.31.0 | ||
|