Skip to content

Commit b982292

Browse files
paulduffinandi34
authored andcommitted
Upgrade to expat 2.1.1
Modified the import_expat.sh script as the archive is now compressed using bzip2 instead of gzip and uses configure.ac instead of configure.in. Modified README.android to make the example command up to date with respect to the new archive format and also to ensure that it builds dependencies. All the remaining changes are straight from upstream. Bug: 27818751 (cherry picked from commit cee23496d017f13eccc125e2ab7044de53dec8da) Change-Id: Ic75a6c455dbcc34aaa7c30c109dc1565c5c52b04 (cherry picked from commit c05e032be5350e70e721727a96d5d4309f74af01)
1 parent 0af0cb3 commit b982292

File tree

14 files changed

+153
-129
lines changed

14 files changed

+153
-129
lines changed

Changes

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
Release 2.1.1 Sat March 12 2016
2+
Security fixes:
3+
#582: CVE-2015-1283 - Multiple integer overflows in XML_GetBuffer
4+
5+
Bug fixes:
6+
#502: Fix potential null pointer dereference
7+
#520: Symbol XML_SetHashSalt was not exported
8+
Output of "xmlwf -h" was incomplete
9+
10+
Other changes
11+
#503: Document behavior of calling XML_SetHashSalt with salt 0
12+
Minor improvements to man page xmlwf(1)
13+
Improvements to the experimental CMake build system
14+
libtool now invoked with --verbose
15+
116
Release 2.1.0 Sat March 24 2012
217
- Bug Fixes:
318
#1742315: Harmful XML_ParserCreateNS suggestion.
@@ -23,7 +38,7 @@ Release 2.1.0 Sat March 24 2012
2338
#3312568: CMake support.
2439
#3446384: Report byte offsets for attr names and values.
2540
- New Features / API changes:
26-
Added new API member XML_SetHashSalt() that allows setting an intial
41+
Added new API member XML_SetHashSalt() that allows setting an initial
2742
value (salt) for hash calculations. This is part of the fix for
2843
bug #3496608 to randomize hash parameters.
2944
When compiled with XML_ATTR_INFO defined, adds new API member

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
Expat, Release 2.1.0
2+
Expat, Release 2.1.1
33

44
This is Expat, a C library for parsing XML, written by James Clark.
55
Expat is a stream-oriented XML parser. This means that you register

README.android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Please use ./import_expat.sh to update. For example to import from a tar and rebuild:
22

3-
(croot && cd external/expat && ./import_expat.sh ~/Downloads/expat-2.1.0.tar.gz && mm -j32 -B)
3+
(croot && cd external/expat && ./import_expat.sh ~/Downloads/expat-2.1.1.tar.bz2 && mma -j32 -B)
44

55
When updating to new versions, please remove any unnecessary build
66
files to make the diff of what we are using clearer. It is reasonable

doc/expat.png

2 Bytes
Loading

doc/reference.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,8 +2151,12 @@ <h3><a name="miscellaneous">Miscellaneous functions</a></h3>
21512151
function behavior. In order to have an effect this must be called
21522152
before parsing has started. Returns 1 if successful, 0 when called
21532153
after <code>XML_Parse</code> or <code>XML_ParseBuffer</code>.
2154-
<p><b>Note:</b> This call is optional, as the parser will auto-generate a new
2155-
random salt value if no value has been set at the start of parsing.</p>
2154+
<p><b>Note:</b>This call is optional, as the parser will auto-generate
2155+
a new random salt value if no value has been set at the start of parsing.
2156+
<p><b>Note:</b>One should not call <code>XML_SetHashSalt</code> with a
2157+
hash salt value of 0, as this value is used as sentinel value to indicate
2158+
that <code>XML_SetHashSalt</code> has <b>not</b> been called. Consequently
2159+
such a call will have no effect, even if it returns 1.</p>
21562160
</div>
21572161

21582162
<pre class="fcndec" id="XML_UseForeignDTD">

doc/valid-xhtml10.png

2 Bytes
Loading

doc/xmlwf.1

Lines changed: 102 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,40 @@
1-
.\" This manpage has been automatically generated by docbook2man
2-
.\" from a DocBook document. This tool can be found at:
3-
.\" <http://shell.ipoline.com/~elmert/comp/docbook2X/>
4-
.\" Please send any bug reports, improvements, comments, patches,
5-
.\" etc. to Steve Cheng <steve@ggi-project.org>.
6-
.TH "XMLWF" "1" "24 January 2003" "" ""
1+
'\" -*- coding: us-ascii -*-
2+
.if \n(.g .ds T< \\FC
3+
.if \n(.g .ds T> \\F[\n[.fam]]
4+
.de URL
5+
\\$2 \(la\\$1\(ra\\$3
6+
..
7+
.if \n(.g .mso www.tmac
8+
.TH XMLWF 1 "March 11, 2016" "" ""
79
.SH NAME
810
xmlwf \- Determines if an XML document is well-formed
911
.SH SYNOPSIS
10-
11-
\fBxmlwf\fR [ \fB-s\fR] [ \fB-n\fR] [ \fB-p\fR] [ \fB-x\fR] [ \fB-e \fIencoding\fB\fR] [ \fB-w\fR] [ \fB-d \fIoutput-dir\fB\fR] [ \fB-c\fR] [ \fB-m\fR] [ \fB-r\fR] [ \fB-t\fR] [ \fB-v\fR] [ \fBfile ...\fR]
12-
13-
.SH "DESCRIPTION"
14-
.PP
12+
'nh
13+
.fi
14+
.ad l
15+
\fBxmlwf\fR \kx
16+
.if (\nx>(\n(.l/2)) .nr x (\n(.l/5)
17+
'in \n(.iu+\nxu
18+
[\fB-s\fR] [\fB-n\fR] [\fB-p\fR] [\fB-x\fR] [\fB-e \fIencoding\fB\fR] [\fB-w\fR] [\fB-d \fIoutput-dir\fB\fR] [\fB-c\fR] [\fB-m\fR] [\fB-r\fR] [\fB-t\fR] [\fB-v\fR] [file ...]
19+
'in \n(.iu-\nxu
20+
.ad b
21+
'hy
22+
.SH DESCRIPTION
1523
\fBxmlwf\fR uses the Expat library to
16-
determine if an XML document is well-formed. It is
24+
determine if an XML document is well-formed. It is
1725
non-validating.
1826
.PP
1927
If you do not specify any files on the command-line, and you
2028
have a recent version of \fBxmlwf\fR, the
2129
input file will be read from standard input.
2230
.SH "WELL-FORMED DOCUMENTS"
23-
.PP
2431
A well-formed document must adhere to the
2532
following rules:
2633
.TP 0.2i
2734
\(bu
28-
The file begins with an XML declaration. For instance,
29-
<?xml version="1.0" standalone="yes"?>.
30-
\fBNOTE:\fR
35+
The file begins with an XML declaration. For instance,
36+
\*(T<<?xml version="1.0" standalone="yes"?>\*(T>.
37+
\fINOTE:\fR
3138
\fBxmlwf\fR does not currently
3239
check for a valid XML declaration.
3340
.TP 0.2i
@@ -36,8 +43,8 @@ Every start tag is either empty (<tag/>)
3643
or has a corresponding end tag.
3744
.TP 0.2i
3845
\(bu
39-
There is exactly one root element. This element must contain
40-
all other elements in the document. Only comments, white
46+
There is exactly one root element. This element must contain
47+
all other elements in the document. Only comments, white
4148
space, and processing instructions may come after the close
4249
of the root element.
4350
.TP 0.2i
@@ -49,79 +56,78 @@ All attribute values are enclosed in quotes (either single
4956
or double).
5057
.PP
5158
If the document has a DTD, and it strictly complies with that
52-
DTD, then the document is also considered \fBvalid\fR.
59+
DTD, then the document is also considered \fIvalid\fR.
5360
\fBxmlwf\fR is a non-validating parser --
54-
it does not check the DTD. However, it does support
55-
external entities (see the \fB-x\fR option).
56-
.SH "OPTIONS"
57-
.PP
61+
it does not check the DTD. However, it does support
62+
external entities (see the \*(T<\fB\-x\fR\*(T> option).
63+
.SH OPTIONS
5864
When an option includes an argument, you may specify the argument either
59-
separately ("\fB-d\fR output") or concatenated with the
60-
option ("\fB-d\fRoutput"). \fBxmlwf\fR
65+
separately ("\*(T<\fB\-d\fR\*(T> output") or concatenated with the
66+
option ("\*(T<\fB\-d\fR\*(T>output"). \fBxmlwf\fR
6167
supports both.
62-
.TP
63-
\fB-c\fR
68+
.TP
69+
\*(T<\fB\-c\fR\*(T>
6470
If the input file is well-formed and \fBxmlwf\fR
6571
doesn't encounter any errors, the input file is simply copied to
6672
the output directory unchanged.
67-
This implies no namespaces (turns off \fB-n\fR) and
68-
requires \fB-d\fR to specify an output file.
69-
.TP
70-
\fB-d output-dir\fR
73+
This implies no namespaces (turns off \*(T<\fB\-n\fR\*(T>) and
74+
requires \*(T<\fB\-d\fR\*(T> to specify an output file.
75+
.TP
76+
\*(T<\fB\-d output\-dir\fR\*(T>
7177
Specifies a directory to contain transformed
7278
representations of the input files.
73-
By default, \fB-d\fR outputs a canonical representation
79+
By default, \*(T<\fB\-d\fR\*(T> outputs a canonical representation
7480
(described below).
75-
You can select different output formats using \fB-c\fR
76-
and \fB-m\fR.
81+
You can select different output formats using \*(T<\fB\-c\fR\*(T>
82+
and \*(T<\fB\-m\fR\*(T>.
7783

7884
The output filenames will
7985
be exactly the same as the input filenames or "STDIN" if the input is
80-
coming from standard input. Therefore, you must be careful that the
86+
coming from standard input. Therefore, you must be careful that the
8187
output file does not go into the same directory as the input
82-
file. Otherwise, \fBxmlwf\fR will delete the
88+
file. Otherwise, \fBxmlwf\fR will delete the
8389
input file before it generates the output file (just like running
84-
cat < file > file in most shells).
90+
\*(T<cat < file > file\*(T> in most shells).
8591

8692
Two structurally equivalent XML documents have a byte-for-byte
8793
identical canonical XML representation.
8894
Note that ignorable white space is considered significant and
8995
is treated equivalently to data.
9096
More on canonical XML can be found at
9197
http://www.jclark.com/xml/canonxml.html .
92-
.TP
93-
\fB-e encoding\fR
98+
.TP
99+
\*(T<\fB\-e encoding\fR\*(T>
94100
Specifies the character encoding for the document, overriding
95-
any document encoding declaration. \fBxmlwf\fR
101+
any document encoding declaration. \fBxmlwf\fR
96102
supports four built-in encodings:
97-
US-ASCII,
98-
UTF-8,
99-
UTF-16, and
100-
ISO-8859-1.
101-
Also see the \fB-w\fR option.
102-
.TP
103-
\fB-m\fR
103+
\*(T<US\-ASCII\*(T>,
104+
\*(T<UTF\-8\*(T>,
105+
\*(T<UTF\-16\*(T>, and
106+
\*(T<ISO\-8859\-1\*(T>.
107+
Also see the \*(T<\fB\-w\fR\*(T> option.
108+
.TP
109+
\*(T<\fB\-m\fR\*(T>
104110
Outputs some strange sort of XML file that completely
105111
describes the input file, including character positions.
106-
Requires \fB-d\fR to specify an output file.
107-
.TP
108-
\fB-n\fR
109-
Turns on namespace processing. (describe namespaces)
110-
\fB-c\fR disables namespaces.
111-
.TP
112-
\fB-p\fR
112+
Requires \*(T<\fB\-d\fR\*(T> to specify an output file.
113+
.TP
114+
\*(T<\fB\-n\fR\*(T>
115+
Turns on namespace processing. (describe namespaces)
116+
\*(T<\fB\-c\fR\*(T> disables namespaces.
117+
.TP
118+
\*(T<\fB\-p\fR\*(T>
113119
Tells xmlwf to process external DTDs and parameter
114120
entities.
115121

116122
Normally \fBxmlwf\fR never parses parameter
117-
entities. \fB-p\fR tells it to always parse them.
118-
\fB-p\fR implies \fB-x\fR.
119-
.TP
120-
\fB-r\fR
123+
entities. \*(T<\fB\-p\fR\*(T> tells it to always parse them.
124+
\*(T<\fB\-p\fR\*(T> implies \*(T<\fB\-x\fR\*(T>.
125+
.TP
126+
\*(T<\fB\-r\fR\*(T>
121127
Normally \fBxmlwf\fR memory-maps the XML file
122128
before parsing; this can result in faster parsing on many
123129
platforms.
124-
\fB-r\fR turns off memory-mapping and uses normal file
130+
\*(T<\fB\-r\fR\*(T> turns off memory-mapping and uses normal file
125131
IO calls instead.
126132
Of course, memory-mapping is automatically turned off
127133
when reading from standard input.
@@ -131,34 +137,33 @@ substantially higher memory usage for
131137
\fBxmlwf\fR, but this appears to be a matter of
132138
the operating system reporting memory in a strange way; there is
133139
not a leak in \fBxmlwf\fR.
134-
.TP
135-
\fB-s\fR
140+
.TP
141+
\*(T<\fB\-s\fR\*(T>
136142
Prints an error if the document is not standalone.
137143
A document is standalone if it has no external subset and no
138144
references to parameter entities.
139-
.TP
140-
\fB-t\fR
141-
Turns on timings. This tells Expat to parse the entire file,
145+
.TP
146+
\*(T<\fB\-t\fR\*(T>
147+
Turns on timings. This tells Expat to parse the entire file,
142148
but not perform any processing.
143149
This gives a fairly accurate idea of the raw speed of Expat itself
144150
without client overhead.
145-
\fB-t\fR turns off most of the output options
146-
(\fB-d\fR, \fB-m\fR, \fB-c\fR,
147-
\&...).
148-
.TP
149-
\fB-v\fR
151+
\*(T<\fB\-t\fR\*(T> turns off most of the output options
152+
(\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-m\fR\*(T>, \*(T<\fB\-c\fR\*(T>, ...).
153+
.TP
154+
\*(T<\fB\-v\fR\*(T>
150155
Prints the version of the Expat library being used, including some
151156
information on the compile-time configuration of the library, and
152157
then exits.
153-
.TP
154-
\fB-w\fR
158+
.TP
159+
\*(T<\fB\-w\fR\*(T>
155160
Enables support for Windows code pages.
156161
Normally, \fBxmlwf\fR will throw an error if it
157-
runs across an encoding that it is not equipped to handle itself. With
158-
\fB-w\fR, xmlwf will try to use a Windows code
159-
page. See also \fB-e\fR.
160-
.TP
161-
\fB-x\fR
162+
runs across an encoding that it is not equipped to handle itself. With
163+
\*(T<\fB\-w\fR\*(T>, xmlwf will try to use a Windows code
164+
page. See also \*(T<\fB\-e\fR\*(T>.
165+
.TP
166+
\*(T<\fB\-x\fR\*(T>
162167
Turns on parsing external entities.
163168

164169
Non-validating parsers are not required to resolve external
@@ -178,74 +183,64 @@ This is an example of an internal entity:
178183
And here are some examples of external entities:
179184

180185
.nf
181-
<!ENTITY header SYSTEM "header-&vers;.xml"> (parsed)
186+
<!ENTITY header SYSTEM "header\-&vers;.xml"> (parsed)
182187
<!ENTITY logo SYSTEM "logo.png" PNG> (unparsed)
183188
.fi
184-
.TP
185-
\fB--\fR
189+
.TP
190+
\*(T<\fB\-\-\fR\*(T>
186191
(Two hyphens.)
187-
Terminates the list of options. This is only needed if a filename
188-
starts with a hyphen. For example:
192+
Terminates the list of options. This is only needed if a filename
193+
starts with a hyphen. For example:
189194

190195
.nf
191-
xmlwf -- -myfile.xml
196+
xmlwf \-\- \-myfile.xml
192197
.fi
193198

194199
will run \fBxmlwf\fR on the file
195-
\fI-myfile.xml\fR.
200+
\*(T<\fI\-myfile.xml\fR\*(T>.
196201
.PP
197202
Older versions of \fBxmlwf\fR do not support
198203
reading from standard input.
199-
.SH "OUTPUT"
200-
.PP
204+
.SH OUTPUT
201205
If an input file is not well-formed,
202206
\fBxmlwf\fR prints a single line describing
203-
the problem to standard output. If a file is well formed,
207+
the problem to standard output. If a file is well formed,
204208
\fBxmlwf\fR outputs nothing.
205-
Note that the result code is \fBnot\fR set.
206-
.SH "BUGS"
207-
.PP
208-
According to the W3C standard, an XML file without a
209-
declaration at the beginning is not considered well-formed.
210-
However, \fBxmlwf\fR allows this to pass.
211-
.PP
209+
Note that the result code is \fInot\fR set.
210+
.SH BUGS
212211
\fBxmlwf\fR returns a 0 - noerr result,
213-
even if the file is not well-formed. There is no good way for
212+
even if the file is not well-formed. There is no good way for
214213
a program to use \fBxmlwf\fR to quickly
215214
check a file -- it must parse \fBxmlwf\fR's
216215
standard output.
217216
.PP
218217
The errors should go to standard error, not standard output.
219218
.PP
220-
There should be a way to get \fB-d\fR to send its
219+
There should be a way to get \*(T<\fB\-d\fR\*(T> to send its
221220
output to standard output rather than forcing the user to send
222221
it to a file.
223222
.PP
224223
I have no idea why anyone would want to use the
225-
\fB-d\fR, \fB-c\fR, and
226-
\fB-m\fR options. If someone could explain it to
224+
\*(T<\fB\-d\fR\*(T>, \*(T<\fB\-c\fR\*(T>, and
225+
\*(T<\fB\-m\fR\*(T> options. If someone could explain it to
227226
me, I'd like to add this information to this manpage.
228-
.SH "ALTERNATIVES"
229-
.PP
227+
.SH ALTERNATIVES
230228
Here are some XML validators on the web:
231229

232230
.nf
233-
http://www.hcrc.ed.ac.uk/~richard/xml-check.html
231+
http://www.hcrc.ed.ac.uk/~richard/xml\-check.html
234232
http://www.stg.brown.edu/service/xmlvalid/
235233
http://www.scripting.com/frontier5/xml/code/xmlValidator.html
236234
http://www.xml.com/pub/a/tools/ruwf/check.html
237235
.fi
238236
.SH "SEE ALSO"
239-
.PP
240-
241237
.nf
242238
The Expat home page: http://www.libexpat.org/
243-
The W3 XML specification: http://www.w3.org/TR/REC-xml
239+
The W3 XML specification: http://www.w3.org/TR/REC\-xml
244240
.fi
245-
.SH "AUTHOR"
246-
.PP
247-
This manual page was written by Scott Bronson <bronson@rinspin.com> for
248-
the Debian GNU/Linux system (but may be used by others). Permission is
241+
.SH AUTHOR
242+
This manual page was written by Scott Bronson <\*(T<bronson@rinspin.com\*(T>> for
243+
the Debian GNU/Linux system (but may be used by others). Permission is
249244
granted to copy, distribute and/or modify this document under
250245
the terms of the GNU Free Documentation
251246
License, Version 1.1.

0 commit comments

Comments
 (0)