Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f1454777
Commit
f1454777
authored
Feb 17, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xslt: Import upstream release 1.1.39.
parent
72b78669
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
83 additions
and
50 deletions
+83
-50
extensions.c
libs/xslt/libxslt/extensions.c
+21
-21
imports.c
libs/xslt/libxslt/imports.c
+34
-21
security.c
libs/xslt/libxslt/security.c
+1
-2
transform.c
libs/xslt/libxslt/transform.c
+14
-0
xsltconfig.h
libs/xslt/libxslt/xsltconfig.h
+3
-3
xsltlocale.c
libs/xslt/libxslt/xsltlocale.c
+1
-0
xsltlocale.h
libs/xslt/libxslt/xsltlocale.h
+8
-0
xsltutils.h
libs/xslt/libxslt/xsltutils.h
+1
-3
No files found.
libs/xslt/libxslt/extensions.c
View file @
f1454777
...
...
@@ -12,6 +12,7 @@
#define IN_LIBXSLT
#include "libxslt.h"
#include <stdlib.h>
#include <string.h>
#include <limits.h>
...
...
@@ -26,6 +27,7 @@
#endif
#include <libxml/list.h>
#include <libxml/xmlIO.h>
#include <libxml/threads.h>
#include "xslt.h"
#include "xsltInternals.h"
#include "xsltlocale.h"
...
...
@@ -809,7 +811,6 @@ xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI)
* Old behaviour.
*/
tmpStyle
=
style
;
while
(
tmpStyle
!=
NULL
)
{
if
(
tmpStyle
->
extInfos
!=
NULL
)
{
dataContainer
=
(
xsltExtDataPtr
)
xmlHashLookup
(
tmpStyle
->
extInfos
,
URI
);
...
...
@@ -817,9 +818,6 @@ xsltStyleGetExtData(xsltStylesheetPtr style, const xmlChar * URI)
return
(
dataContainer
->
extData
);
}
}
tmpStyle
=
xsltNextImport
(
tmpStyle
);
}
tmpStyle
=
style
;
#endif
dataContainer
=
...
...
@@ -2351,32 +2349,34 @@ xsltDebugDumpExtensions(FILE * output)
output
=
stdout
;
fprintf
(
output
,
"Registered XSLT Extensions
\n
--------------------------
\n
"
);
if
(
!
xsltFunctionsHash
)
fprintf
(
output
,
"No registered extension functions
\n
"
);
else
{
fprintf
(
output
,
"Registered Extension Functions:
\n
"
);
xmlMutexLock
(
xsltExtMutex
);
if
(
!
xsltFunctionsHash
)
{
fprintf
(
output
,
"No registered extension functions
\n
"
);
}
else
{
fprintf
(
output
,
"Registered extension functions:
\n
"
);
xmlHashScanFull
(
xsltFunctionsHash
,
xsltDebugDumpExtensionsCallback
,
output
);
xmlMutexUnlock
(
xsltExtMutex
);
}
if
(
!
xsltElementsHash
)
fprintf
(
output
,
"
\n
No registered extension elements
\n
"
);
else
{
fprintf
(
output
,
"
\n
Registered Extension Elements:
\n
"
);
xmlMutexLock
(
xsltExtMutex
);
if
(
!
xsltTopLevelsHash
)
{
fprintf
(
output
,
"
\n
No registered top-level extension elements
\n
"
);
}
else
{
fprintf
(
output
,
"
\n
Registered top-level extension elements:
\n
"
);
xmlHashScanFull
(
xsltTopLevelsHash
,
xsltDebugDumpExtensionsCallback
,
output
);
}
if
(
!
xsltElementsHash
)
{
fprintf
(
output
,
"
\n
No registered instruction extension elements
\n
"
);
}
else
{
fprintf
(
output
,
"
\n
Registered instruction extension elements:
\n
"
);
xmlHashScanFull
(
xsltElementsHash
,
xsltDebugDumpExtensionsCallback
,
output
);
xmlMutexUnlock
(
xsltExtMutex
);
}
if
(
!
xsltExtensionsHash
)
if
(
!
xsltExtensionsHash
)
{
fprintf
(
output
,
"
\n
No registered extension modules
\n
"
);
else
{
fprintf
(
output
,
"
\n
Registered Extension Modules:
\n
"
);
xmlMutexLock
(
xsltExtMutex
);
}
else
{
fprintf
(
output
,
"
\n
Registered extension modules:
\n
"
);
xmlHashScanFull
(
xsltExtensionsHash
,
xsltDebugDumpExtModulesCallback
,
output
);
xmlMutexUnlock
(
xsltExtMutex
);
}
xmlMutexUnlock
(
xsltExtMutex
);
}
libs/xslt/libxslt/imports.c
View file @
f1454777
...
...
@@ -15,7 +15,7 @@
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/
tree
.h>
#include <libxml/
parser
.h>
#include <libxml/hash.h>
#include <libxml/xmlerror.h>
#include <libxml/uri.h>
...
...
@@ -53,29 +53,49 @@ static void xsltFixImportedCompSteps(xsltStylesheetPtr master,
}
}
#define XSLT_MAX_NESTING 40
static
int
xsltCheckCycle
(
xsltStylesheetPtr
style
,
const
xmlChar
*
URI
)
{
xsltCheckCycle
(
xsltStylesheetPtr
style
,
xmlNodePtr
cur
,
const
xmlChar
*
URI
)
{
xsltStylesheetPtr
ancestor
;
xsltDocumentPtr
docptr
;
int
depth
;
/*
* in order to detect recursion, we check all previously included
* stylesheets.
* Check imported stylesheets.
*/
docptr
=
style
->
includes
;
while
(
docptr
!=
NULL
)
{
if
(
xmlStrEqual
(
docptr
->
doc
->
URL
,
URI
))
depth
=
0
;
ancestor
=
style
;
while
(
ancestor
!=
NULL
)
{
if
(
++
depth
>=
XSLT_MAX_NESTING
)
{
xsltTransformError
(
NULL
,
style
,
cur
,
"maximum nesting depth exceeded: %s
\n
"
,
URI
);
return
(
-
1
);
}
if
(
xmlStrEqual
(
ancestor
->
doc
->
URL
,
URI
))
{
xsltTransformError
(
NULL
,
style
,
cur
,
"recursion detected on imported URL %s
\n
"
,
URI
);
return
(
-
1
);
docptr
=
docptr
->
includes
;
}
/*
* Also check import
ed stylesheets.
* Check includ
ed stylesheets.
*/
ancestor
=
style
;
while
(
ancestor
!=
NULL
)
{
if
(
xmlStrEqual
(
ancestor
->
doc
->
URL
,
URI
))
docptr
=
ancestor
->
includes
;
while
(
docptr
!=
NULL
)
{
if
(
++
depth
>=
XSLT_MAX_NESTING
)
{
xsltTransformError
(
NULL
,
style
,
cur
,
"maximum nesting depth exceeded: %s
\n
"
,
URI
);
return
(
-
1
);
}
if
(
xmlStrEqual
(
docptr
->
doc
->
URL
,
URI
))
{
xsltTransformError
(
NULL
,
style
,
cur
,
"recursion detected on included URL %s
\n
"
,
URI
);
return
(
-
1
);
}
docptr
=
docptr
->
includes
;
}
ancestor
=
ancestor
->
parent
;
}
...
...
@@ -120,11 +140,8 @@ xsltParseStylesheetImport(xsltStylesheetPtr style, xmlNodePtr cur) {
goto
error
;
}
if
(
xsltCheckCycle
(
style
,
URI
)
<
0
)
{
xsltTransformError
(
NULL
,
style
,
cur
,
"xsl:import : recursion detected on imported URL %s
\n
"
,
URI
);
if
(
xsltCheckCycle
(
style
,
cur
,
URI
)
<
0
)
goto
error
;
}
/*
* Security framework check
...
...
@@ -213,11 +230,8 @@ xsltParseStylesheetInclude(xsltStylesheetPtr style, xmlNodePtr cur) {
goto
error
;
}
if
(
xsltCheckCycle
(
style
,
URI
)
<
0
)
{
xsltTransformError
(
NULL
,
style
,
cur
,
"xsl:include : recursion detected on included URL %s
\n
"
,
URI
);
if
(
xsltCheckCycle
(
style
,
cur
,
URI
)
<
0
)
goto
error
;
}
include
=
xsltLoadStyleDocument
(
style
,
URI
);
if
(
include
==
NULL
)
{
...
...
@@ -406,4 +420,3 @@ xsltFindTemplate(xsltTransformContextPtr ctxt, const xmlChar *name,
}
return
(
NULL
);
}
libs/xslt/libxslt/security.c
View file @
f1454777
...
...
@@ -37,7 +37,7 @@
#endif
#include <libxml/xmlmemory.h>
#include <libxml/
tree
.h>
#include <libxml/
parser
.h>
#include <libxml/uri.h>
#include "xslt.h"
#include "xsltInternals.h"
...
...
@@ -463,4 +463,3 @@ xsltCheckRead(xsltSecurityPrefsPtr sec,
xmlFreeURI
(
uri
);
return
(
1
);
}
libs/xslt/libxslt/transform.c
View file @
f1454777
...
...
@@ -1992,7 +1992,21 @@ xsltDefaultProcessOneNode(xsltTransformContextPtr ctxt, xmlNodePtr node,
case
XML_ELEMENT_NODE
:
ctxt
->
xpathCtxt
->
contextSize
=
nbchild
;
ctxt
->
xpathCtxt
->
proximityPosition
=
childno
;
if
(
ctxt
->
depth
>=
ctxt
->
maxTemplateDepth
)
{
xsltTransformError
(
ctxt
,
NULL
,
cur
,
"xsltDefaultProcessOneNode: Maximum template depth "
"exceeded.
\n
"
"You can adjust xsltMaxDepth (--maxdepth) in order to "
"raise the maximum number of nested template calls and "
"variables/params (currently set to %d).
\n
"
,
ctxt
->
maxTemplateDepth
);
ctxt
->
state
=
XSLT_STATE_STOPPED
;
return
;
}
ctxt
->
depth
++
;
xsltProcessOneNode
(
ctxt
,
cur
,
params
);
ctxt
->
depth
--
;
break
;
case
XML_CDATA_SECTION_NODE
:
template
=
xsltGetTemplate
(
ctxt
,
cur
,
NULL
);
...
...
libs/xslt/libxslt/xsltconfig.h
View file @
f1454777
...
...
@@ -20,21 +20,21 @@ extern "C" {
*
* the version string like "1.2.3"
*/
#define LIBXSLT_DOTTED_VERSION "1.1.3
8
"
#define LIBXSLT_DOTTED_VERSION "1.1.3
9
"
/**
* LIBXSLT_VERSION:
*
* the version number: 1.2.3 value is 10203
*/
#define LIBXSLT_VERSION 1013
8
#define LIBXSLT_VERSION 1013
9
/**
* LIBXSLT_VERSION_STRING:
*
* the version number string, 1.2.3 value is "10203"
*/
#define LIBXSLT_VERSION_STRING "1013
8
"
#define LIBXSLT_VERSION_STRING "1013
9
"
/**
* LIBXSLT_VERSION_EXTRA:
...
...
libs/xslt/libxslt/xsltlocale.c
View file @
f1454777
...
...
@@ -15,6 +15,7 @@
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/threads.h>
#include "xsltlocale.h"
#include "xsltutils.h"
...
...
libs/xslt/libxslt/xsltlocale.h
View file @
f1454777
...
...
@@ -14,6 +14,10 @@
#include <libxml/xmlstring.h>
#include "xsltexports.h"
#ifdef __cplusplus
extern
"C"
{
#endif
XSLTPUBFUN
void
*
XSLTCALL
xsltNewLocale
(
const
xmlChar
*
langName
,
int
lowerFirst
);
...
...
@@ -33,4 +37,8 @@ XSLTPUBFUN int XSLTCALL
const
xmlChar
*
str1
,
const
xmlChar
*
str2
);
#ifdef __cplusplus
}
#endif
#endif
/* __XML_XSLTLOCALE_H__ */
libs/xslt/libxslt/xsltutils.h
View file @
f1454777
...
...
@@ -164,7 +164,7 @@ XSLTPUBFUN void XSLTCALL
xsltSetTransformErrorFunc
(
xsltTransformContextPtr
ctxt
,
void
*
ctx
,
xmlGenericErrorFunc
handler
);
XSLTPUBFUN
void
WINAPIV
XSLTPUBFUN
void
XSLTCALL
xsltTransformError
(
xsltTransformContextPtr
ctxt
,
xsltStylesheetPtr
style
,
xmlNodePtr
node
,
...
...
@@ -339,5 +339,3 @@ XSLTPUBFUN void XSLTCALL
#endif
#endif
/* __XML_XSLTUTILS_H__ */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment