Skip to content

Commit

Permalink
Update to libxslt-1.1.40
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyolee committed Jun 14, 2024
1 parent 909f989 commit dbcd319
Show file tree
Hide file tree
Showing 19 changed files with 110 additions and 79 deletions.
21 changes: 21 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
NEWS file for libxslt

v1.1.40: Jun 12 2024

### Removals

- xsltproc: remove maxparserdepth option (Mike Dalessio)

### Improvements

- functions: xmlXPtrNewContext is deprecated
- xsltproc: Stop calling xmlMemoryDump
- xsltproc: Prefer XML_PARSE_NONET over xmlNoNetEntityLoader
- functions: Fix build if libxml2 modules are disabled
- extensions: Don't call deprecated xmlCheckFilename
- documents: Don't set ctxt->directory
- exslt: Fix EXSLT functions without parameters

### Build systems

- build: Remove mem-debug option


v1.1.39: Nov 16 2023

### Bug fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

libxslt Windows build with Visual Studio.

This version is libxslt-1.1.39.
This version is libxslt-1.1.40.

Note that LZMA support is now available for libxml2-2.12.0 or later but only for VS2013 or later.

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion distfiles/download.url
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.39.tar.xz
https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.40.tar.xz
Binary file removed distfiles/libxslt-1.1.39.tar.xz
Binary file not shown.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
0cd9a07afbeb24026c9b03aecfeba458 Copyright
0d9bd2fa90bd3a631ca9d9aabd801345 FEATURES
0204c456fe221f77aff226b90e9aab06 INSTALL
49304be4d12c1e3319ca190832dc8551 NEWS
07dcb2cd9ac5f5ffef5968553286b100 NEWS
eef64f647c5d3389744959576a6ab6fd README.libxslt.md
1671e62be479162b8d9a012c81bc235e TODO
8912730100a2f79c41f5dd2723a9a32b libexslt/common.c
Expand All @@ -13,7 +13,7 @@ f9fef3bf112c1ad9e3befecc89d24ed4 libexslt/crypto.c
d33e58bd10bcc83e0feabf76eb071ca6 libexslt/exslt.c
e3f739c7235640b1ba7c8e8928a63c82 libexslt/exslt.h
4a24ae19aba4feafb1acd0e8d4e880cb libexslt/exsltexports.h
a65c793f8696274d69d2217d328d5100 libexslt/functions.c
9c827585e79fd57f929071eadc224ef6 libexslt/functions.c
7ce44d0060940ebdff26709d8ef46214 libexslt/libexslt.h
5f0739e9a825c3623ba1b40b0008261f libexslt/math.c
3bce123d618557a268f12b13c9457b4b libexslt/saxon.c
Expand All @@ -22,13 +22,13 @@ a65c793f8696274d69d2217d328d5100 libexslt/functions.c
1196d3fb4f29723819f6da12cf695e27 libxslt/attributes.c
2dd0d8f663f0bfbb044589e38c531265 libxslt/attributes.h
ad65dd2bf68938a4a1df976f5de6b04b libxslt/attrvt.c
488475fe4a9f28ce8684f349bd106025 libxslt/documents.c
22210fc799609bee1b1d552dc557f07d libxslt/documents.c
22a35bd1102fd1ac301e50cf650a8b8a libxslt/documents.h
6a94551a598170505a3b9e74c97e3c18 libxslt/extensions.c
0ab2911004218a355377d5117d7d03bf libxslt/extensions.c
45e4867f0daebf1eb905471a4be5184c libxslt/extensions.h
e203d3012061029953db472adc29f3d3 libxslt/extra.c
94fe9ce1c0c47724aae4a1bcb8c29433 libxslt/extra.h
9f5c347324987ef3a141d67af8791812 libxslt/functions.c
a6b2cbb8cd1dccec345b9b1cb0e6c178 libxslt/functions.c
052fd28e9971416b2bbebdc3d1103c4e libxslt/functions.h
6d4aaa7ff80654536ce32bf36602fa03 libxslt/imports.c
66e26ad969e3c37fdeedcbc2716d7cf3 libxslt/imports.h
Expand All @@ -51,16 +51,16 @@ e91ef8a6b4f87ffa2816224b61c91e9e libxslt/security.c
ccbcce4553f3231003b1944002814246 libxslt/transform.h
7da7b1fcf378330699c7ecdd96908641 libxslt/trio.h
e41149b088de4a04c067c85969f4db3c libxslt/triodef.h
d42b039f528b04af5f95a524429f0d65 libxslt/variables.c
64536b62c35e2021724eeb0e1e122ba5 libxslt/variables.c
08a56c0d4d50e48e897bf5eb4554d525 libxslt/variables.h
30a96d6a98177fcdb5d23aa65a70f59d libxslt/win32config.h
776e881558938cc3a79833ef80d6a3e4 libxslt/xslt.c
be63f15730982f24d415fcd7b5b53330 libxslt/xslt.c
0c08b8e7223b72f822a58457520b6387 libxslt/xslt.h
0c68b707553010c769cfa211c71da8f1 libxslt/xsltInternals.h
bba1fa0c21b057828bb3056fe124dd75 libxslt/xsltInternals.h
f9de2ff0a2e168ccf84d1bed6339d41d libxslt/xsltexports.h
bcfda4b3c33123d13ef1652ddeb499c8 libxslt/xsltlocale.c
da1d63c112c339b051a9155359b6d2d7 libxslt/xsltlocale.h
bd4637142f205d1664246f15be69e3e4 libxslt/xsltutils.c
9eeea4bbd2cbafc8a7ed24420cb9b11c libxslt/xsltutils.h
f9b47b748a9212f0ac0e85b2abdaebd1 xsltproc/testThreads.c
961dc002dcb359f04c3875a4dcc966a7 xsltproc/xsltproc.c
cff031fc94f7f45e58e1559e4065029b xsltproc/testThreads.c
6893c7e37fb52e73ae5df02f748c2e14 xsltproc/xsltproc.c
Binary file added distfiles/libxslt-1.1.40.tar.xz
Binary file not shown.
22 changes: 14 additions & 8 deletions libexslt/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,15 @@ exsltFuncFunctionFunction (xmlXPathParserContextPtr ctxt, int nargs) {
newBase = tctxt->varsNr;
/* If there are any parameters */
if (paramNode != NULL) {
args = (xmlXPathObjectPtr *) xmlMalloc(sizeof(*args) * nargs);
if (args == NULL)
goto error;
/* Fetch the stored argument values from the caller */
for (i = nargs - 1; i >= 0; i--) {
args[i] = valuePop(ctxt);
}
if (nargs > 0) {
args = (xmlXPathObjectPtr *) xmlMalloc(sizeof(*args) * nargs);
if (args == NULL)
goto error;
/* Fetch the stored argument values from the caller */
for (i = nargs - 1; i >= 0; i--) {
args[i] = valuePop(ctxt);
}
}

/*
* Prepare to process params in reverse order. First, go to
Expand Down Expand Up @@ -791,7 +793,11 @@ exsltFuncResultElem (xsltTransformContextPtr ctxt,
"exsltFuncResultElem: ret == NULL\n");
data->error = 1;
} else {
ret->boolval = 0; /* Freeing is not handled there anymore */
/*
* This stops older libxml2 versions from freeing the nodes
* in the tree.
*/
ret->boolval = 0;
}
} else {
/* If the func:result element has empty content and does not
Expand Down
2 changes: 0 additions & 2 deletions libxslt/documents.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,6 @@ xsltDocDefaultLoaderFunc(const xmlChar * URI, xmlDictPtr dict, int options,
return(NULL);
}
inputPush(pctxt, inputStream);
if (pctxt->directory == NULL)
pctxt->directory = xmlParserGetDirectory((const char *) URI);

xmlParseDocument(pctxt);

Expand Down
11 changes: 0 additions & 11 deletions libxslt/extensions.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,17 +415,6 @@ xsltExtModuleRegisterDynamic(const xmlChar * URI)
module_filename, URI);
#endif

if (1 != xmlCheckFilename(module_filename)) {

#ifdef WITH_XSLT_DEBUG_EXTENSIONS
xsltGenericDebug(xsltGenericDebugContext,
"xmlCheckFilename failed for plugin: %s\n", module_filename);
#endif

xmlFree(ext_name);
return (-1);
}

/* attempt to open the module */
m = xmlModuleOpen(module_filename, 0);
if (NULL == m) {
Expand Down
19 changes: 7 additions & 12 deletions libxslt/functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,26 +100,26 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
{
xsltTransformContextPtr tctxt;
xmlURIPtr uri;
xmlChar *fragment;
xmlChar *fragment = NULL;
xsltDocumentPtr idoc; /* document info */
xmlDocPtr doc;
xmlXPathContextPtr xptrctxt = NULL;
xmlXPathObjectPtr resObj = NULL;

(void) xptrctxt;

tctxt = xsltXPathGetTransformContext(ctxt);
if (tctxt == NULL) {
xsltTransformError(NULL, NULL, NULL,
"document() : internal error tctxt == NULL\n");
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
return;
goto out_fragment;
}

uri = xmlParseURI((const char *) URI);
if (uri == NULL) {
xsltTransformError(tctxt, NULL, NULL,
"document() : failed to parse URI\n");
valuePush(ctxt, xmlXPathNewNodeSet(NULL));
return;
goto out_fragment;
}

/*
Expand Down Expand Up @@ -147,12 +147,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)
*/
doc = tctxt->style->doc;
} else {
valuePush(ctxt, xmlXPathNewNodeSet(NULL));

if (fragment != NULL)
xmlFree(fragment);

return;
goto out_fragment;
}
} else
doc = idoc->doc;
Expand All @@ -164,7 +159,7 @@ xsltDocumentFunctionLoadDocument(xmlXPathParserContextPtr ctxt, xmlChar* URI)

/* use XPointer of HTML location for fragment ID */
#ifdef LIBXML_XPTR_ENABLED
xptrctxt = xmlXPtrNewContext(doc, NULL, NULL);
xptrctxt = xmlXPathNewContext(doc);
if (xptrctxt == NULL) {
xsltTransformError(tctxt, NULL, NULL,
"document() : internal error xptrctxt == NULL\n");
Expand Down
14 changes: 9 additions & 5 deletions libxslt/variables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1010,10 +1010,10 @@ xsltEvalVariable(xsltTransformContextPtr ctxt, xsltStackElemPtr variable,
if (result == NULL) {
result = xmlXPathNewCString("");
} else {
/*
* Freeing is not handled there anymore.
* QUESTION TODO: What does the above comment mean?
*/
/*
* This stops older libxml2 versions from freeing the nodes
* in the tree.
*/
result->boolval = 0;
}
#ifdef WITH_XSLT_DEBUG_VARIABLE
Expand Down Expand Up @@ -1232,7 +1232,11 @@ xsltEvalGlobalVariable(xsltStackElemPtr elem, xsltTransformContextPtr ctxt)
if (result == NULL) {
result = xmlXPathNewCString("");
} else {
result->boolval = 0; /* Freeing is not handled there anymore */
/*
* This stops older libxml2 versions from freeing the nodes
* in the tree.
*/
result->boolval = 0;
}
#ifdef WITH_XSLT_DEBUG_VARIABLE
#ifdef LIBXML_DEBUG_ENABLED
Expand Down
40 changes: 38 additions & 2 deletions libxslt/xslt.c
Original file line number Diff line number Diff line change
Expand Up @@ -4460,6 +4460,8 @@ xsltParseSequenceConstructor(xsltCompilerCtxtPtr cctxt, xmlNodePtr cur)
* NOTE that this content model does *not* allow xsl:param.
*/
while (cur != NULL) {
cctxt->style->principal->opCount += 1;

if (deleteNode != NULL) {
#ifdef WITH_XSLT_DEBUG_BLANKS
xsltGenericDebug(xsltGenericDebugContext,
Expand Down Expand Up @@ -4500,7 +4502,11 @@ xsltParseSequenceConstructor(xsltCompilerCtxtPtr cctxt, xmlNodePtr cur)
* Leave the contained text-node in the tree.
*/
xmlUnlinkNode(tmp);
xmlAddPrevSibling(cur, tmp);
if (xmlAddPrevSibling(cur, tmp) == NULL) {
xsltTransformError(ctxt, NULL, NULL,
"out of memory\n");
xmlFreeNode(tmp);
}
} else {
tmp = NULL;
xsltTransformError(NULL, cctxt->style, cur,
Expand Down Expand Up @@ -4854,6 +4860,8 @@ xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ) {
* user-defined extension instruction if needed).
*/
do {
style->principal->opCount += 1;

if ((child->type == XML_ELEMENT_NODE) &&
IS_XSLT_ELEM_FAST(child) &&
IS_XSLT_NAME(child, "param"))
Expand Down Expand Up @@ -4897,6 +4905,8 @@ xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ) {
cur = templ->children;
delete = NULL;
while (cur != NULL) {
style->principal->opCount += 1;

if (delete != NULL) {
#ifdef WITH_XSLT_DEBUG_BLANKS
xsltGenericDebug(xsltGenericDebugContext,
Expand Down Expand Up @@ -4986,7 +4996,11 @@ xsltParseTemplateContent(xsltStylesheetPtr style, xmlNodePtr templ) {

next = text->next;
xmlUnlinkNode(text);
xmlAddPrevSibling(cur, text);
if (xmlAddPrevSibling(cur, text) == NULL) {
xsltTransformError(NULL, style, NULL,
"out of memory\n");
xmlFreeNode(text);
}
text = next;
}
}
Expand Down Expand Up @@ -5366,6 +5380,15 @@ xsltParseStylesheetTemplate(xsltStylesheetPtr style, xmlNodePtr template) {
(template->type != XML_ELEMENT_NODE))
return;

if (style->principal->opLimit > 0) {
if (style->principal->opCount > style->principal->opLimit) {
xsltTransformError(NULL, style, NULL,
"XSLT parser operation limit exceeded\n");
style->errors++;
return;
}
}

/*
* Create and link the structure
*/
Expand Down Expand Up @@ -6090,6 +6113,15 @@ xsltParseStylesheetTop(xsltStylesheetPtr style, xmlNodePtr top) {
if ((top == NULL) || (top->type != XML_ELEMENT_NODE))
return;

if (style->principal->opLimit > 0) {
if (style->principal->opCount > style->principal->opLimit) {
xsltTransformError(NULL, style, NULL,
"XSLT parser operation limit exceeded\n");
style->errors++;
return;
}
}

prop = xmlGetNsProp(top, (const xmlChar *)"version", NULL);
if (prop == NULL) {
xsltTransformError(NULL, style, top,
Expand All @@ -6113,6 +6145,8 @@ xsltParseStylesheetTop(xsltStylesheetPtr style, xmlNodePtr top) {
*/
cur = top->children;
while (cur != NULL) {
style->principal->opCount += 1;

if (IS_BLANK_NODE(cur)) {
cur = cur->next;
continue;
Expand All @@ -6129,6 +6163,8 @@ xsltParseStylesheetTop(xsltStylesheetPtr style, xmlNodePtr top) {
* process other top-level elements
*/
while (cur != NULL) {
style->principal->opCount += 1;

if (IS_BLANK_NODE(cur)) {
cur = cur->next;
continue;
Expand Down
3 changes: 3 additions & 0 deletions libxslt/xsltInternals.h
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,9 @@ struct _xsltStylesheet {
xmlHashTablePtr namedTemplates; /* hash table of named templates */

xmlXPathContextPtr xpathCtxt;

unsigned long opLimit;
unsigned long opCount;
};

typedef struct _xsltTransformCache xsltTransformCache;
Expand Down
6 changes: 3 additions & 3 deletions libxslt/xsltconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ extern "C" {
*
* the version string like "1.2.3"
*/
#define LIBXSLT_DOTTED_VERSION "1.1.39"
#define LIBXSLT_DOTTED_VERSION "1.1.40"

/**
* LIBXSLT_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXSLT_VERSION 10139
#define LIBXSLT_VERSION 10140

/**
* LIBXSLT_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXSLT_VERSION_STRING "10139"
#define LIBXSLT_VERSION_STRING "10140"

/**
* LIBXSLT_VERSION_EXTRA:
Expand Down
4 changes: 2 additions & 2 deletions win32/rcVersion.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define LIBXSLT_MAJOR_VERSION 1
#define LIBXSLT_MINOR_VERSION 1
#define LIBXSLT_MICRO_VERSION 39
#define LIBXSLT_DOTTED_VERSION "1.1.39"
#define LIBXSLT_MICRO_VERSION 40
#define LIBXSLT_DOTTED_VERSION "1.1.40"

#define LIBEXSLT_MAJOR_VERSION 0
#define LIBEXSLT_MINOR_VERSION 8
Expand Down
1 change: 0 additions & 1 deletion xsltproc/testThreads.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ main(void)
}
xsltCleanupGlobals();
xmlCleanupParser();
xmlMemoryDump();
printf("Ok\n");
return (0);
}
Expand Down
Loading

0 comments on commit dbcd319

Please sign in to comment.