nokogiri 1.11.4 → 1.11.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of nokogiri might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a73d0d0bba6227291bb1780b081dd2620881949ec0621e51d83457da13a98717
|
4
|
+
data.tar.gz: 2b6a3899b2368fa153d5de232e0dd7e04bd1a925ddebbfb0fb248956a9de8247
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f798c33192a0b25e1d57aa62b6eefbf3ccab6e0563f86357688e0cc75a7a714e83d48b0fc1cceb22f3c740005a61800c908e8e62cf6147663450950976941ca3
|
7
|
+
data.tar.gz: 0cbb1ab65d2299c10e39ff19b2df63fb7c50daf94ffc4062031239caa5455d1f81c6ac32ea4c3a5ca71a41e49184271fcccc28b8f8b226f64507de98775c71e0
|
data/ext/nokogiri/nokogiri.c
CHANGED
@@ -191,7 +191,26 @@ Init_nokogiri()
|
|
191
191
|
rb_const_set(mNokogiri, rb_intern("OTHER_LIBRARY_VERSIONS"), NOKOGIRI_STR_NEW2(NOKOGIRI_OTHER_LIBRARY_VERSIONS));
|
192
192
|
#endif
|
193
193
|
|
194
|
+
#if defined(_WIN32) && !defined(NOKOGIRI_PACKAGED_LIBRARIES)
|
195
|
+
/*
|
196
|
+
* We choose *not* to do use Ruby's memory management functions with windows DLLs because of this
|
197
|
+
* issue in libxml 2.9.12:
|
198
|
+
*
|
199
|
+
* https://github.com/sparklemotion/nokogiri/issues/2241
|
200
|
+
*
|
201
|
+
* If the atexit() issue gets fixed in a future version of libxml2, then we may be able to skip
|
202
|
+
* this config only for the specific libxml2 versions 2.9.12.
|
203
|
+
*
|
204
|
+
* Alternatively, now that Ruby has a generational GC, it might be OK to let libxml2 use its
|
205
|
+
* default memory management functions (recall that this config was introduced to reduce memory
|
206
|
+
* bloat and allow Ruby to GC more often); but we should *really* test with production workloads
|
207
|
+
* before making that kind of a potentially-invasive change.
|
208
|
+
*/
|
209
|
+
rb_const_set(mNokogiri, rb_intern("LIBXML_MEMORY_MANAGEMENT"), NOKOGIRI_STR_NEW2("default"));
|
210
|
+
#else
|
211
|
+
rb_const_set(mNokogiri, rb_intern("LIBXML_MEMORY_MANAGEMENT"), NOKOGIRI_STR_NEW2("ruby"));
|
194
212
|
xmlMemSetup((xmlFreeFunc)ruby_xfree, (xmlMallocFunc)ruby_xmalloc, (xmlReallocFunc)ruby_xrealloc, ruby_strdup);
|
213
|
+
#endif
|
195
214
|
|
196
215
|
xmlInitParser();
|
197
216
|
|
data/ext/nokogiri/xml_node.c
CHANGED
@@ -1292,17 +1292,25 @@ get_name(VALUE self)
|
|
1292
1292
|
* Returns the path associated with this Node
|
1293
1293
|
*/
|
1294
1294
|
static VALUE
|
1295
|
-
|
1295
|
+
noko_xml_node_path(VALUE rb_node)
|
1296
1296
|
{
|
1297
|
-
xmlNodePtr
|
1298
|
-
xmlChar *
|
1297
|
+
xmlNodePtr c_node;
|
1298
|
+
xmlChar *c_path ;
|
1299
1299
|
VALUE rval;
|
1300
1300
|
|
1301
|
-
Data_Get_Struct(
|
1301
|
+
Data_Get_Struct(rb_node, xmlNode, c_node);
|
1302
|
+
|
1303
|
+
c_path = xmlGetNodePath(c_node);
|
1304
|
+
if (c_path == NULL) {
|
1305
|
+
// see https://github.com/sparklemotion/nokogiri/issues/2250
|
1306
|
+
// this behavior is clearly undesirable, but is what libxml <= 2.9.10 returned, and so we
|
1307
|
+
// do this for now to preserve the behavior across libxml2 versions.
|
1308
|
+
rval = NOKOGIRI_STR_NEW2("?");
|
1309
|
+
} else {
|
1310
|
+
rval = NOKOGIRI_STR_NEW2(c_path);
|
1311
|
+
xmlFree(c_path);
|
1312
|
+
}
|
1302
1313
|
|
1303
|
-
path = xmlGetNodePath(node);
|
1304
|
-
rval = NOKOGIRI_STR_NEW2(path);
|
1305
|
-
xmlFree(path);
|
1306
1314
|
return rval ;
|
1307
1315
|
}
|
1308
1316
|
|
@@ -1779,7 +1787,7 @@ noko_init_xml_node()
|
|
1779
1787
|
rb_define_method(cNokogiriXmlNode, "next_element", next_element, 0);
|
1780
1788
|
rb_define_method(cNokogiriXmlNode, "previous_element", previous_element, 0);
|
1781
1789
|
rb_define_method(cNokogiriXmlNode, "node_type", node_type, 0);
|
1782
|
-
rb_define_method(cNokogiriXmlNode, "path",
|
1790
|
+
rb_define_method(cNokogiriXmlNode, "path", noko_xml_node_path, 0);
|
1783
1791
|
rb_define_method(cNokogiriXmlNode, "key?", key_eh, 1);
|
1784
1792
|
rb_define_method(cNokogiriXmlNode, "namespaced_key?", namespaced_key_eh, 2);
|
1785
1793
|
rb_define_method(cNokogiriXmlNode, "blank?", blank_eh, 0);
|
@@ -137,6 +137,7 @@ module Nokogiri
|
|
137
137
|
else
|
138
138
|
libxml["source"] = "system"
|
139
139
|
end
|
140
|
+
libxml["memory_management"] = Nokogiri::LIBXML_MEMORY_MANAGEMENT
|
140
141
|
libxml["iconv_enabled"] = libxml2_has_iconv?
|
141
142
|
libxml["compiled"] = compiled_libxml_version.to_s
|
142
143
|
libxml["loaded"] = loaded_libxml_version.to_s
|
@@ -0,0 +1,31 @@
|
|
1
|
+
From 3e1aad4fe584747fd7d17cc7b2863a78e2d21a77 Mon Sep 17 00:00:00 2001
|
2
|
+
From: Nick Wellnhofer <wellnhofer@aevum.de>
|
3
|
+
Date: Wed, 2 Jun 2021 17:31:49 +0200
|
4
|
+
Subject: [PATCH] Fix XPath recursion limit
|
5
|
+
|
6
|
+
Fix accounting of recursion depth when parsing XPath expressions.
|
7
|
+
|
8
|
+
This silly bug introduced in commit 804c5297 could lead to spurious
|
9
|
+
errors when parsing larger expressions or XSLT documents.
|
10
|
+
|
11
|
+
Should fix #264.
|
12
|
+
---
|
13
|
+
xpath.c | 2 +-
|
14
|
+
1 file changed, 1 insertion(+), 1 deletion(-)
|
15
|
+
|
16
|
+
diff --git a/xpath.c b/xpath.c
|
17
|
+
index 7497ba0..1aa2f1a 100644
|
18
|
+
--- a/xpath.c
|
19
|
+
+++ b/xpath.c
|
20
|
+
@@ -10983,7 +10983,7 @@ xmlXPathCompileExpr(xmlXPathParserContextPtr ctxt, int sort) {
|
21
|
+
}
|
22
|
+
|
23
|
+
if (xpctxt != NULL)
|
24
|
+
- xpctxt->depth -= 1;
|
25
|
+
+ xpctxt->depth -= 10;
|
26
|
+
}
|
27
|
+
|
28
|
+
/**
|
29
|
+
--
|
30
|
+
2.31.0
|
31
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogiri
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Dalessio
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire:
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2021-
|
20
|
+
date: 2021-06-02 00:00:00.000000000 Z
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
23
23
|
name: racc
|
@@ -377,6 +377,7 @@ files:
|
|
377
377
|
- patches/libxml2/0004-use-glibc-strlen.patch
|
378
378
|
- patches/libxml2/0005-avoid-isnan-isinf.patch
|
379
379
|
- patches/libxml2/0006-update-automake-files-for-arm64.patch
|
380
|
+
- patches/libxml2/0007-Fix-XPath-recursion-limit.patch
|
380
381
|
- patches/libxslt/0001-update-automake-files-for-arm64.patch
|
381
382
|
- patches/libxslt/0002-Fix-xml2-config-check-in-configure-script.patch
|
382
383
|
- ports/archives/libxml2-2.9.12.tar.gz
|
@@ -407,7 +408,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
407
408
|
- !ruby/object:Gem::Version
|
408
409
|
version: '0'
|
409
410
|
requirements: []
|
410
|
-
rubygems_version: 3.
|
411
|
+
rubygems_version: 3.2.19
|
411
412
|
signing_key:
|
412
413
|
specification_version: 4
|
413
414
|
summary: Nokogiri (鋸) makes it easy and painless to work with XML and HTML from Ruby.
|