Sha256: ae521f0bd1d28d92bfb7c37868cd35d737428c054baab4676471045e4e811e4b

Contents?: true

Size: 766 Bytes

Versions: 10

Compression:

Stored size: 766 Bytes

Contents

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

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nokogiri-1.13.1 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.13.0 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.12.5 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.12.4 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.12.3 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.12.2 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.12.1 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.12.0 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.12.0.rc1 patches/libxml2/0007-Fix-XPath-recursion-limit.patch
nokogiri-1.11.7 patches/libxml2/0007-Fix-XPath-recursion-limit.patch