8000 dep: update packaged libxml2 to v2.14.4 by flavorjones · Pull Request #3499 · sparklemotion/nokogiri · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

dep: update packaged libxml2 to v2.14.4 #3499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions dependencies.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
libxml2:
version: "2.13.8"
sha256: "277294cb33119ab71b2bc81f2f445e9bc9435b893ad15bb2cd2b0e859a0ee84a"
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.13/libxml2-2.13.8.sha256sum
version: "2.14.4"
sha256: "24175ec30a97cfa86bdf9befb7ccf4613f8f4b2713c5103e0dd0bc9c711a2773"
# sha-256 hash provided in https://download.gnome.org/sources/libxml2/2.14/libxml2-2.14.1.sha256sum

libxslt:
version: "1.1.43"
Expand Down
70 changes: 35 additions & 35 deletions patches/libxml2/0001-Remove-script-macro-support.patch
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
From 27e4aa8d885e47a296ea78d114dbbe8fc7aa3508 Mon Sep 17 00:00:00 2001
From: Kevin Solorio <soloriok@gmail.com>
Date: Fri, 1 Feb 2019 14:32:42 -0800
Subject: [PATCH] Revert-support-html-h-b-7-1
commit fc1fed5d
Author: Mike Dalessio <mike@37signals.com>
Date: 2025-04-05 16:34:26 -0400

---
entities.c | 17 -----------------
1 file changed, 17 deletions(-)
patches/libxml2/0001-Remove-script-macro-support.patch

diff --git a/entities.c b/entities.c
index 43549bc5..82652f6d 100644
index 0a32f0b4..c30814d0 100644
--- a/entities.c
+++ b/entities.c
@@ -623,23 +623,6 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
*out++ = 't';
*out++ = ';';
} else if (*cur == '&') {
- /*
- * Special handling of &{...} construct from HTML 4, see
- * http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
- */
- if (html && attr && (cur[1] == '{') &&
- (strchr((const char *) cur, '}'))) {
- while (*cur != '}') {
- *out++ = *cur++;
- indx = out - buffer;
- if (indx + 100 > buffer_size) {
- growBufferReentrant();
- out = &buffer[indx];
- }
- }
- *out++ = *cur++;
- continue;
- }
*out++ = '&';
*out++ = 'a';
*out++ = 'm';
--
2.16.2

@@ -689,29 +689,22 @@ xmlEscapeText(const xmlChar *text, int flags) {
replSize = 4;
}
} else if (c == '>') {
repl = BAD_CAST "&gt;";
replSize = 4;
} else if (c == '&') {
/*
* Special handling of &{...} construct from HTML 4, see
* http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
*/
- if ((flags & XML_ESCAPE_HTML) && (flags & XML_ESCAPE_ATTR) &&
- (cur[1] == '{') && (end = xmlStrchr(cur, '}'))) {
- chunkSize = (end - cur) + 1;
- repl = cur;
- replSize = chunkSize;
- } else {
repl = BAD_CAST "&amp;";
replSize = 5;
- }
} else if ((flags & XML_ESCAPE_QUOT) && (c == '"')) {
repl = BAD_CAST "&quot;";
replSize = 6;
} else if (((flags & XML_ESCAPE_HTML) == 0) && (c == '\r')) {
repl = BAD_CAST "&#13;";
replSize = 5;
} else if ((flags & XML_ESCAPE_NON_ASCII) && (c >= 0x80)) {
int val;

chunkSize = 4;
Original file line number Diff line number Diff line change
@@ -1,44 +1,41 @@
From ffc08467744bd2305d41ca882c37fa30adf3a067 Mon Sep 17 00:00:00 2001
From: Kevin Solorio <soloriok@gmail.com>
Date: Wed, 27 Feb 2019 14:34:17 -0800
Subject: [PATCH 2/2] update entities.c to remove handling of ssi
commit d2e57c4b
Author: Mike Dalessio <mike@37signals.com>
Date: 2025-04-05 16:37:23 -0400

---
entities.c | 21 ---------------------
1 file changed, 21 deletions(-)
patches/libxml2/0002-Update-entities-to-remove-handling-of-ssi.patch

diff --git a/entities.c b/entities.c
index 43549bc5..5c4a2a60 100644
index c30814d0..186534c5 100644
--- a/entities.c
+++ b/entities.c
@@ -592,27 +592,6 @@ xmlEncodeEntitiesInternal(xmlDocPtr doc, const xmlChar *input, int attr) {
* By default one have to encode at least '<', '>', '"' and '&' !
*/
if (*cur == '<') {
- const xmlChar *end;
-
- /*
- * Special handling of server side include in HTML attributes
- */
- if (html && attr &&
@@ -671,30 +671,22 @@ xmlEscapeText(const xmlChar *text, int flags) {
}

if (c == 0) {
chunkSize = 0;
repl = BAD_CAST "";
replSize = 0;
} else if (c == '<') {
/*
* Special handling of server side include in HTML attributes
*/
- if ((flags & XML_ESCAPE_HTML) && (flags & XML_ESCAPE_ATTR) &&
- (cur[1] == '!') && (cur[2] == '-') && (cur[3] == '-') &&
- ((end = xmlStrstr(cur, BAD_CAST "-->")) != NULL)) {
- while (cur != end) {
- *out++ = *cur++;
- indx = out - buffer;
- if (indx + 100 > buffer_size) {
- growBufferReentrant();
- out = &buffer[indx];
- }
- }
- *out++ = *cur++;
- *out++ = *cur++;
- *out++ = *cur++;
- continue;
- }
*out++ = '&';
*out++ = 'l';
*out++ = 't';
--
2.16.2

- chunkSize = (end - cur) + 3;
- repl = cur;
- replSize = chunkSize;
- } else {
repl = BAD_CAST "&lt;";
replSize = 4;
- }
} else if (c == '>') {
repl = BAD_CAST "&gt;";
replSize = 4;
} else if (c == '&') {
/*
* Special handling of &{...} construct from HTML 4, see
* http://www.w3.org/TR/html401/appendix/notes.html#h-B.7.1
*/
repl = BAD_CAST "&amp;";
replSize = 5;
125 changes: 94 additions & 31 deletions patches/libxml2/0009-allow-wildcard-namespaces.patch
6D40
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
From 74c95ec5932c737d4fcb06b8646b0017364ada14 Mon Sep 17 00:00:00 2001
From: Mike Dalessio <mike.dalessio@gmail.com>
Date: Fri, 24 Dec 2021 19:08:01 -0500
Subject: [PATCH] attempt to hack in wildcard namespaces to xpath
commit db4c6d02 (HEAD -> flavorjones/nokogiri-patch-set)
Author: Mike Dalessio <mike@37signals.com>
Date: 2025-04-05 16:54:48 -0400

I'm not confident this is a bulletproof patch.
---
xpath.c | 24 ++++++++++++++++++------
1 file changed, 18 insertions(+), 6 deletions(-)
patches/libxml2/0009-allow-wildcard-namespaces.patch

diff --git a/xpath.c b/xpath.c
index 1aa2f1a..c7f0885 100644
index 7be6cfdc..7a3db312 100644
--- a/xpath.c
+++ b/xpath.c
@@ -146,6 +146,9 @@
@@ -118,20 +118,23 @@
*/
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
#define XPATH_MAX_RECURSION_DEPTH 500
#elif defined(_WIN32)
/* Windows typically limits stack size to 1MB. */
#define XPATH_MAX_RECURSION_DEPTH 1000
#else
#define XPATH_MAX_RECURSION_DEPTH 5000
#endif

Expand All @@ -22,7 +25,21 @@ index 1aa2f1a..c7f0885 100644
/*
* TODO:
* There are a few spots where some tests are done which depend upon ascii
@@ -11073,12 +11076,15 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,
* data. These should be enhanced for full UTF8 support (see particularly
* any use of the macros IS_ASCII_CHARACTER and IS_ASCII_DIGIT)
*/

#if defined(LIBXML_XPATH_ENABLED)

static void
@@ -9748,26 +9751,29 @@ xmlXPathCompNodeTest(xmlXPathParserContextPtr ctxt, xmlXPathTestVal *test,

if ((test == NULL) || (type == NULL) || (prefix == NULL)) {
return(NULL);
}
*type = (xmlXPathTypeVal) 0;
*test = (xmlXPathTestVal) 0;
*prefix = NULL;
SKIP_BLANKS;

if ((name == NULL) && (CUR == '*')) {
Expand All @@ -32,29 +49,57 @@ index 1aa2f1a..c7f0885 100644
NEXT;
- *test = NODE_TEST_ALL;
- return(NULL);
+ if (CUR != ':') {
+ /*
+ * All elements
+ */
+ *test = NODE_TEST_ALL;
+ return(NULL);
+ }
+ name = xmlCharStrdup(WILDCARD_PREFIX);
+ if (CUR != ':') {
+ /*
+ * All elements
+ */
+ *test = NODE_TEST_ALL;
+ return(NULL);
+ }
+ name = xmlCharStrdup(WILDCARD_PREFIX);
}

if (name == NULL)
@@ -11327,6 +11333,10 @@ xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
}
#endif
name = xmlXPathParseNCName(ctxt);
if (name == NULL) {
XP_ERRORNULL(XPATH_EXPR_ERROR);
}

blanks = IS_BLANK_CH(CUR);
SKIP_BLANKS;
@@ -9957,20 +9963,24 @@ xmlXPathCompStep(xmlXPathParserContextPtr ctxt) {
SKIP_BLANKS;
} else {
xmlChar *name = NULL;
xmlChar *prefix = NULL;
xmlXPathTestVal test = (xmlXPathTestVal) 0;
xmlXPathAxisVal axis = (xmlXPathAxisVal) 0;
xmlXPathTypeVal type = (xmlXPathTypeVal) 0;
int op1;

if (CUR == '*') {
+ if (NXT(1) == ':') {
+ NEXT;
+ name = xmlCharStrdup(WILDCARD_PREFIX);
+ }
+ if (NXT(1) == ':') {
+ NEXT;
+ name = xmlCharStrdup(WILDCARD_PREFIX);
+ }
axis = AXIS_CHILD;
} else {
if (name == NULL)
@@ -12030,7 +12040,7 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
name = xmlXPathParseNCName(ctxt);
if (name != NULL) {
axis = xmlXPathIsAxisName(name);
if (axis != 0) {
SKIP_BLANKS;
if ((CUR == ':') && (NXT(1) == ':')) {
SKIP(2);
@@ -10418,21 +10428,21 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
xmlXPathNodeSetMergeFunction mergeAndClear;
xmlNodePtr oldContextNode;
xmlXPathContextPtr xpctxt = ctxt->context;


CHECK_TYPE0(XPATH_NODESET);
obj = xmlXPathValuePop(ctxt);
/*
* Setup namespaces.
*/
Expand All @@ -63,7 +108,21 @@ index 1aa2f1a..c7f0885 100644
URI = xmlXPathNsLookup(xpctxt, prefix);
if (URI == NULL) {
xmlXPathReleaseObject(xpctxt, obj);
@@ -12369,6 +12379,8 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
XP_ERROR0(XPATH_UNDEF_PREFIX_ERROR);
}
}
/*
* Setup axis.
*
* MAYBE FUTURE TODO: merging optimizations:
@@ -10743,20 +10753,22 @@ xmlXPathNodeCollectAndTest(xmlXPathParserContextPtr ctxt,
break;
}
switch (cur->type) {
case XML_ELEMENT_NODE:
if (xmlStrEqual(name, cur->name)) {
if (prefix == NULL) {
if (cur->ns == NULL)
{
XP_TEST_HIT
}
Expand All @@ -72,6 +131,10 @@ index 1aa2f1a..c7f0885 100644
} else {
if ((cur->ns != NULL) &&
(xmlStrEqual(URI, cur->ns->href)))
--
2.31.0

{
XP_TEST_HIT
}
}
}
break;
case XML_ATTRIBUTE_NODE:{

This file was deleted.

Loading
Loading
0