Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
d0b03aa2
Commit
d0b03aa2
authored
Nov 08, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xml2: Import upstream release 2.10.3.
parent
fd3017ff
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
41 additions
and
79 deletions
+41
-79
HTMLparser.c
libs/xml2/HTMLparser.c
+6
-21
SAX2.c
libs/xml2/SAX2.c
+10
-14
entities.c
libs/xml2/entities.c
+16
-39
win32config.h
libs/xml2/include/win32config.h
+6
-2
parser.c
libs/xml2/parser.c
+0
-0
tree.c
libs/xml2/tree.c
+2
-1
xpath.c
libs/xml2/xpath.c
+1
-2
No files found.
libs/xml2/HTMLparser.c
View file @
d0b03aa2
...
@@ -5056,8 +5056,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
...
@@ -5056,8 +5056,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
htmlErrMemory
(
NULL
,
"htmlInitParserCtxt: out of memory
\n
"
);
htmlErrMemory
(
NULL
,
"htmlInitParserCtxt: out of memory
\n
"
);
return
(
-
1
);
return
(
-
1
);
}
}
else
memset
(
sax
,
0
,
sizeof
(
htmlSAXHandler
));
memset
(
sax
,
0
,
sizeof
(
htmlSAXHandler
));
/* Allocate the Input stack */
/* Allocate the Input stack */
ctxt
->
inputTab
=
(
htmlParserInputPtr
*
)
ctxt
->
inputTab
=
(
htmlParserInputPtr
*
)
...
@@ -5116,11 +5115,9 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
...
@@ -5116,11 +5115,9 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
ctxt
->
nodeInfoNr
=
0
;
ctxt
->
nodeInfoNr
=
0
;
ctxt
->
nodeInfoMax
=
0
;
ctxt
->
nodeInfoMax
=
0
;
if
(
sax
==
NULL
)
ctxt
->
sax
=
(
xmlSAXHandlerPtr
)
&
htmlDefaultSAXHandler
;
ctxt
->
sax
=
sax
;
else
{
xmlSAX2InitHtmlDefaultSAXHandler
(
sax
);
ctxt
->
sax
=
sax
;
memcpy
(
sax
,
&
htmlDefaultSAXHandler
,
sizeof
(
xmlSAXHandlerV1
));
}
ctxt
->
userData
=
ctxt
;
ctxt
->
userData
=
ctxt
;
ctxt
->
myDoc
=
NULL
;
ctxt
->
myDoc
=
NULL
;
ctxt
->
wellFormed
=
1
;
ctxt
->
wellFormed
=
1
;
...
@@ -7116,22 +7113,10 @@ htmlDocPtr
...
@@ -7116,22 +7113,10 @@ htmlDocPtr
htmlCtxtReadDoc
(
htmlParserCtxtPtr
ctxt
,
const
xmlChar
*
cur
,
htmlCtxtReadDoc
(
htmlParserCtxtPtr
ctxt
,
const
xmlChar
*
cur
,
const
char
*
URL
,
const
char
*
encoding
,
int
options
)
const
char
*
URL
,
const
char
*
encoding
,
int
options
)
{
{
xmlParserInputPtr
stream
;
if
(
cur
==
NULL
)
if
(
cur
==
NULL
)
return
(
NULL
);
return
(
NULL
);
if
(
ctxt
==
NULL
)
return
(
htmlCtxtReadMemory
(
ctxt
,
(
const
char
*
)
cur
,
xmlStrlen
(
cur
),
URL
,
return
(
NULL
);
encoding
,
options
));
xmlInitParser
();
htmlCtxtReset
(
ctxt
);
stream
=
xmlNewStringInputStream
(
ctxt
,
cur
);
if
(
stream
==
NULL
)
{
return
(
NULL
);
}
inputPush
(
ctxt
,
stream
);
return
(
htmlDoRead
(
ctxt
,
URL
,
encoding
,
options
,
1
));
}
}
/**
/**
...
...
libs/xml2/SAX2.c
View file @
d0b03aa2
...
@@ -28,11 +28,6 @@
...
@@ -28,11 +28,6 @@
#include <libxml/HTMLtree.h>
#include <libxml/HTMLtree.h>
#include <libxml/globals.h>
#include <libxml/globals.h>
/* Define SIZE_T_MAX unless defined through <limits.h>. */
#ifndef SIZE_T_MAX
# define SIZE_T_MAX ((size_t)-1)
#endif
/* !SIZE_T_MAX */
/* #define DEBUG_SAX2 */
/* #define DEBUG_SAX2 */
/* #define DEBUG_SAX2_TREE */
/* #define DEBUG_SAX2_TREE */
...
@@ -2596,22 +2591,23 @@ xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
...
@@ -2596,22 +2591,23 @@ xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters: xmlStrdup returned NULL"
);
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters: xmlStrdup returned NULL"
);
return
;
return
;
}
}
if
(((
size_t
)
ctxt
->
nodelen
+
(
size_t
)
len
>
XML_MAX_TEXT_LENGTH
)
&&
if
(
ctxt
->
nodelen
>
INT_MAX
-
len
)
{
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters overflow prevented"
);
return
;
}
if
((
ctxt
->
nodelen
+
len
>
XML_MAX_TEXT_LENGTH
)
&&
((
ctxt
->
options
&
XML_PARSE_HUGE
)
==
0
))
{
((
ctxt
->
options
&
XML_PARSE_HUGE
)
==
0
))
{
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters: huge text node"
);
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters: huge text node"
);
return
;
return
;
}
}
if
((
size_t
)
ctxt
->
nodelen
>
SIZE_T_MAX
-
(
size_t
)
len
||
(
size_t
)
ctxt
->
nodemem
+
(
size_t
)
len
>
SIZE_T_MAX
/
2
)
{
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters overflow prevented"
);
return
;
}
if
(
ctxt
->
nodelen
+
len
>=
ctxt
->
nodemem
)
{
if
(
ctxt
->
nodelen
+
len
>=
ctxt
->
nodemem
)
{
xmlChar
*
newbuf
;
xmlChar
*
newbuf
;
size_
t
size
;
in
t
size
;
size
=
ctxt
->
nodemem
+
len
;
size
=
ctxt
->
nodemem
>
INT_MAX
-
len
?
size
*=
2
;
INT_MAX
:
ctxt
->
nodemem
+
len
;
size
=
size
>
INT_MAX
/
2
?
INT_MAX
:
size
*
2
;
newbuf
=
(
xmlChar
*
)
xmlRealloc
(
lastChild
->
content
,
size
);
newbuf
=
(
xmlChar
*
)
xmlRealloc
(
lastChild
->
content
,
size
);
if
(
newbuf
==
NULL
)
{
if
(
newbuf
==
NULL
)
{
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters"
);
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters"
);
...
...
libs/xml2/entities.c
View file @
d0b03aa2
...
@@ -128,36 +128,19 @@ xmlFreeEntity(xmlEntityPtr entity)
...
@@ -128,36 +128,19 @@ xmlFreeEntity(xmlEntityPtr entity)
if
((
entity
->
children
)
&&
(
entity
->
owner
==
1
)
&&
if
((
entity
->
children
)
&&
(
entity
->
owner
==
1
)
&&
(
entity
==
(
xmlEntityPtr
)
entity
->
children
->
parent
))
(
entity
==
(
xmlEntityPtr
)
entity
->
children
->
parent
))
xmlFreeNodeList
(
entity
->
children
);
xmlFreeNodeList
(
entity
->
children
);
if
(
dict
!=
NULL
)
{
if
((
entity
->
name
!=
NULL
)
&&
if
((
entity
->
name
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
name
)))
((
dict
==
NULL
)
||
(
!
xmlDictOwns
(
dict
,
entity
->
name
))))
xmlFree
((
char
*
)
entity
->
name
);
xmlFree
((
char
*
)
entity
->
name
);
if
((
entity
->
ExternalID
!=
NULL
)
&&
if
(
entity
->
ExternalID
!=
NULL
)
(
!
xmlDictOwns
(
dict
,
entity
->
ExternalID
)))
xmlFree
((
char
*
)
entity
->
ExternalID
);
xmlFree
((
char
*
)
entity
->
ExternalID
);
if
(
entity
->
SystemID
!=
NULL
)
if
((
entity
->
SystemID
!=
NULL
)
&&
xmlFree
((
char
*
)
entity
->
SystemID
);
(
!
xmlDictOwns
(
dict
,
entity
->
SystemID
)))
if
(
entity
->
URI
!=
NULL
)
xmlFree
((
char
*
)
entity
->
SystemID
);
xmlFree
((
char
*
)
entity
->
URI
);
if
((
entity
->
URI
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
URI
)))
if
(
entity
->
content
!=
NULL
)
xmlFree
((
char
*
)
entity
->
URI
);
xmlFree
((
char
*
)
entity
->
content
);
if
((
entity
->
content
!=
NULL
)
if
(
entity
->
orig
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
content
)))
xmlFree
((
char
*
)
entity
->
orig
);
xmlFree
((
char
*
)
entity
->
content
);
if
((
entity
->
orig
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
orig
)))
xmlFree
((
char
*
)
entity
->
orig
);
}
else
{
if
(
entity
->
name
!=
NULL
)
xmlFree
((
char
*
)
entity
->
name
);
if
(
entity
->
ExternalID
!=
NULL
)
xmlFree
((
char
*
)
entity
->
ExternalID
);
if
(
entity
->
SystemID
!=
NULL
)
xmlFree
((
char
*
)
entity
->
SystemID
);
if
(
entity
->
URI
!=
NULL
)
xmlFree
((
char
*
)
entity
->
URI
);
if
(
entity
->
content
!=
NULL
)
xmlFree
((
char
*
)
entity
->
content
);
if
(
entity
->
orig
!=
NULL
)
xmlFree
((
char
*
)
entity
->
orig
);
}
xmlFree
(
entity
);
xmlFree
(
entity
);
}
}
...
@@ -193,18 +176,12 @@ xmlCreateEntity(xmlDictPtr dict, const xmlChar *name, int type,
...
@@ -193,18 +176,12 @@ xmlCreateEntity(xmlDictPtr dict, const xmlChar *name, int type,
ret
->
SystemID
=
xmlStrdup
(
SystemID
);
ret
->
SystemID
=
xmlStrdup
(
SystemID
);
}
else
{
}
else
{
ret
->
name
=
xmlDictLookup
(
dict
,
name
,
-
1
);
ret
->
name
=
xmlDictLookup
(
dict
,
name
,
-
1
);
if
(
ExternalID
!=
NULL
)
ret
->
ExternalID
=
xmlStrdup
(
ExternalID
);
ret
->
ExternalID
=
xmlDictLookup
(
dict
,
ExternalID
,
-
1
);
ret
->
SystemID
=
xmlStrdup
(
SystemID
);
if
(
SystemID
!=
NULL
)
ret
->
SystemID
=
xmlDictLookup
(
dict
,
SystemID
,
-
1
);
}
}
if
(
content
!=
NULL
)
{
if
(
content
!=
NULL
)
{
ret
->
length
=
xmlStrlen
(
content
);
ret
->
length
=
xmlStrlen
(
content
);
if
((
dict
!=
NULL
)
&&
(
ret
->
length
<
5
))
ret
->
content
=
xmlStrndup
(
content
,
ret
->
length
);
ret
->
content
=
(
xmlChar
*
)
xmlDictLookup
(
dict
,
content
,
ret
->
length
);
else
ret
->
content
=
xmlStrndup
(
content
,
ret
->
length
);
}
else
{
}
else
{
ret
->
length
=
0
;
ret
->
length
=
0
;
ret
->
content
=
NULL
;
ret
->
content
=
NULL
;
...
...
libs/xml2/include/win32config.h
View file @
d0b03aa2
...
@@ -15,9 +15,13 @@
...
@@ -15,9 +15,13 @@
#define HAVE_STDINT_H
#define HAVE_STDINT_H
#endif
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
#if defined(_MSC_VER)
#if _MSC_VER < 1900
#define snprintf _snprintf
#define snprintf _snprintf
#define vsnprintf _vsnprintf
#endif
#if _MSC_VER < 1500
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
#endif
#endif
#endif
#endif
/* __LIBXML_WIN32_CONFIG__ */
#endif
/* __LIBXML_WIN32_CONFIG__ */
...
...
libs/xml2/parser.c
View file @
d0b03aa2
This diff is collapsed.
Click to expand it.
libs/xml2/tree.c
View file @
d0b03aa2
...
@@ -9604,7 +9604,8 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
...
@@ -9604,7 +9604,8 @@ xmlDOMWrapCloneNode(xmlDOMWrapCtxtPtr ctxt,
/*
/*
* Attributes (xmlAttr).
* Attributes (xmlAttr).
*/
*/
clone
=
(
xmlNodePtr
)
xmlMalloc
(
sizeof
(
xmlAttr
));
/* Use xmlRealloc to avoid -Warray-bounds warning */
clone
=
(
xmlNodePtr
)
xmlRealloc
(
NULL
,
sizeof
(
xmlAttr
));
if
(
clone
==
NULL
)
{
if
(
clone
==
NULL
)
{
xmlTreeErrMemory
(
"xmlDOMWrapCloneNode(): allocating an attr-node"
);
xmlTreeErrMemory
(
"xmlDOMWrapCloneNode(): allocating an attr-node"
);
goto
internal_error
;
goto
internal_error
;
...
...
libs/xml2/xpath.c
View file @
d0b03aa2
...
@@ -10503,7 +10503,7 @@ xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
...
@@ -10503,7 +10503,7 @@ xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
static
xmlChar
*
static
xmlChar
*
xmlXPathScanName
(
xmlXPathParserContextPtr
ctxt
)
{
xmlXPathScanName
(
xmlXPathParserContextPtr
ctxt
)
{
int
l
en
=
0
,
l
;
int
l
;
int
c
;
int
c
;
const
xmlChar
*
cur
;
const
xmlChar
*
cur
;
xmlChar
*
ret
;
xmlChar
*
ret
;
...
@@ -10523,7 +10523,6 @@ xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
...
@@ -10523,7 +10523,6 @@ xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
(
c
==
'_'
)
||
(
c
==
':'
)
||
(
c
==
'_'
)
||
(
c
==
':'
)
||
(
IS_COMBINING
(
c
))
||
(
IS_COMBINING
(
c
))
||
(
IS_EXTENDER
(
c
))))
{
(
IS_EXTENDER
(
c
))))
{
len
+=
l
;
NEXTL
(
l
);
NEXTL
(
l
);
c
=
CUR_CHAR
(
l
);
c
=
CUR_CHAR
(
l
);
}
}
...
...
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