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
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)
htmlErrMemory
(
NULL
,
"htmlInitParserCtxt: out of memory
\n
"
);
return
(
-
1
);
}
else
memset
(
sax
,
0
,
sizeof
(
htmlSAXHandler
));
memset
(
sax
,
0
,
sizeof
(
htmlSAXHandler
));
/* Allocate the Input stack */
ctxt
->
inputTab
=
(
htmlParserInputPtr
*
)
...
...
@@ -5116,11 +5115,9 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt)
ctxt
->
nodeInfoNr
=
0
;
ctxt
->
nodeInfoMax
=
0
;
if
(
sax
==
NULL
)
ctxt
->
sax
=
(
xmlSAXHandlerPtr
)
&
htmlDefaultSAXHandler
;
else
{
ctxt
->
sax
=
sax
;
memcpy
(
sax
,
&
htmlDefaultSAXHandler
,
sizeof
(
xmlSAXHandlerV1
));
}
ctxt
->
sax
=
sax
;
xmlSAX2InitHtmlDefaultSAXHandler
(
sax
);
ctxt
->
userData
=
ctxt
;
ctxt
->
myDoc
=
NULL
;
ctxt
->
wellFormed
=
1
;
...
...
@@ -7116,22 +7113,10 @@ htmlDocPtr
htmlCtxtReadDoc
(
htmlParserCtxtPtr
ctxt
,
const
xmlChar
*
cur
,
const
char
*
URL
,
const
char
*
encoding
,
int
options
)
{
xmlParserInputPtr
stream
;
if
(
cur
==
NULL
)
return
(
NULL
);
if
(
ctxt
==
NULL
)
return
(
NULL
);
xmlInitParser
();
htmlCtxtReset
(
ctxt
);
stream
=
xmlNewStringInputStream
(
ctxt
,
cur
);
if
(
stream
==
NULL
)
{
return
(
NULL
);
}
inputPush
(
ctxt
,
stream
);
return
(
htmlDoRead
(
ctxt
,
URL
,
encoding
,
options
,
1
));
return
(
htmlCtxtReadMemory
(
ctxt
,
(
const
char
*
)
cur
,
xmlStrlen
(
cur
),
URL
,
encoding
,
options
));
}
/**
...
...
libs/xml2/SAX2.c
View file @
d0b03aa2
...
...
@@ -28,11 +28,6 @@
#include <libxml/HTMLtree.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_TREE */
...
...
@@ -2596,22 +2591,23 @@ xmlSAX2Text(xmlParserCtxtPtr ctxt, const xmlChar *ch, int len,
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters: xmlStrdup returned NULL"
);
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
))
{
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters: huge text node"
);
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
)
{
xmlChar
*
newbuf
;
size_
t
size
;
in
t
size
;
size
=
ctxt
->
nodemem
+
len
;
size
*=
2
;
size
=
ctxt
->
nodemem
>
INT_MAX
-
len
?
INT_MAX
:
ctxt
->
nodemem
+
len
;
size
=
size
>
INT_MAX
/
2
?
INT_MAX
:
size
*
2
;
newbuf
=
(
xmlChar
*
)
xmlRealloc
(
lastChild
->
content
,
size
);
if
(
newbuf
==
NULL
)
{
xmlSAX2ErrMemory
(
ctxt
,
"xmlSAX2Characters"
);
...
...
libs/xml2/entities.c
View file @
d0b03aa2
...
...
@@ -128,36 +128,19 @@ xmlFreeEntity(xmlEntityPtr entity)
if
((
entity
->
children
)
&&
(
entity
->
owner
==
1
)
&&
(
entity
==
(
xmlEntityPtr
)
entity
->
children
->
parent
))
xmlFreeNodeList
(
entity
->
children
);
if
(
dict
!=
NULL
)
{
if
((
entity
->
name
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
name
)))
xmlFree
((
char
*
)
entity
->
name
);
if
((
entity
->
ExternalID
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
ExternalID
)))
xmlFree
((
char
*
)
entity
->
ExternalID
);
if
((
entity
->
SystemID
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
SystemID
)))
xmlFree
((
char
*
)
entity
->
SystemID
);
if
((
entity
->
URI
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
URI
)))
xmlFree
((
char
*
)
entity
->
URI
);
if
((
entity
->
content
!=
NULL
)
&&
(
!
xmlDictOwns
(
dict
,
entity
->
content
)))
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
);
}
if
((
entity
->
name
!=
NULL
)
&&
((
dict
==
NULL
)
||
(
!
xmlDictOwns
(
dict
,
entity
->
name
))))
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
);
}
...
...
@@ -193,18 +176,12 @@ xmlCreateEntity(xmlDictPtr dict, const xmlChar *name, int type,
ret
->
SystemID
=
xmlStrdup
(
SystemID
);
}
else
{
ret
->
name
=
xmlDictLookup
(
dict
,
name
,
-
1
);
if
(
ExternalID
!=
NULL
)
ret
->
ExternalID
=
xmlDictLookup
(
dict
,
ExternalID
,
-
1
);
if
(
SystemID
!=
NULL
)
ret
->
SystemID
=
xmlDictLookup
(
dict
,
SystemID
,
-
1
);
ret
->
ExternalID
=
xmlStrdup
(
ExternalID
);
ret
->
SystemID
=
xmlStrdup
(
SystemID
);
}
if
(
content
!=
NULL
)
{
ret
->
length
=
xmlStrlen
(
content
);
if
((
dict
!=
NULL
)
&&
(
ret
->
length
<
5
))
ret
->
content
=
(
xmlChar
*
)
xmlDictLookup
(
dict
,
content
,
ret
->
length
);
else
ret
->
content
=
xmlStrndup
(
content
,
ret
->
length
);
ret
->
content
=
xmlStrndup
(
content
,
ret
->
length
);
}
else
{
ret
->
length
=
0
;
ret
->
content
=
NULL
;
...
...
libs/xml2/include/win32config.h
View file @
d0b03aa2
...
...
@@ -15,9 +15,13 @@
#define HAVE_STDINT_H
#endif
#if defined(_MSC_VER) && _MSC_VER < 1900
#if defined(_MSC_VER)
#if _MSC_VER < 1900
#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
/* __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,
/*
* Attributes (xmlAttr).
*/
clone
=
(
xmlNodePtr
)
xmlMalloc
(
sizeof
(
xmlAttr
));
/* Use xmlRealloc to avoid -Warray-bounds warning */
clone
=
(
xmlNodePtr
)
xmlRealloc
(
NULL
,
sizeof
(
xmlAttr
));
if
(
clone
==
NULL
)
{
xmlTreeErrMemory
(
"xmlDOMWrapCloneNode(): allocating an attr-node"
);
goto
internal_error
;
...
...
libs/xml2/xpath.c
View file @
d0b03aa2
...
...
@@ -10503,7 +10503,7 @@ xmlXPathCompFilterExpr(xmlXPathParserContextPtr ctxt) {
static
xmlChar
*
xmlXPathScanName
(
xmlXPathParserContextPtr
ctxt
)
{
int
l
en
=
0
,
l
;
int
l
;
int
c
;
const
xmlChar
*
cur
;
xmlChar
*
ret
;
...
...
@@ -10523,7 +10523,6 @@ xmlXPathScanName(xmlXPathParserContextPtr ctxt) {
(
c
==
'_'
)
||
(
c
==
':'
)
||
(
IS_COMBINING
(
c
))
||
(
IS_EXTENDER
(
c
))))
{
len
+=
l
;
NEXTL
(
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