Update the embedded copy of the expat XML parser to 2.1.0. It brings
with it a vareity of bug fixes, both security and behavior. See
http://www.libexpat.org/ for the list.
NOTE: I already backported the expat hash randomization fix in March.
Fixes issue #14340.
diff --git a/Modules/expat/xmltok.c b/Modules/expat/xmltok.c
index db92247..bf09dfc 100644
--- a/Modules/expat/xmltok.c
+++ b/Modules/expat/xmltok.c
@@ -2,20 +2,22 @@
See the file COPYING for copying permission.
*/
+#include <stddef.h>
+
#ifdef COMPILED_FROM_DSP
#include "winconfig.h"
#elif defined(MACOS_CLASSIC)
#include "macconfig.h"
-#elif defined(__amigaos4__)
+#elif defined(__amigaos__)
#include "amigaconfig.h"
+#elif defined(__WATCOMC__)
+#include "watcomconfig.h"
#else
#ifdef HAVE_EXPAT_CONFIG_H
#include <expat_config.h>
#endif
#endif /* ndef COMPILED_FROM_DSP */
-#include <stddef.h>
-
#include "expat_external.h"
#include "internal.h"
#include "xmltok.h"
@@ -295,7 +297,9 @@
#endif
#define PREFIX(ident) normal_ ## ident
+#define XML_TOK_IMPL_C
#include "xmltok_impl.c"
+#undef XML_TOK_IMPL_C
#undef MINBPC
#undef BYTE_TYPE
@@ -692,7 +696,9 @@
#define IS_NMSTRT_CHAR(enc, p, n) (0)
#define IS_NMSTRT_CHAR_MINBPC(enc, p) LITTLE2_IS_NMSTRT_CHAR_MINBPC(enc, p)
+#define XML_TOK_IMPL_C
#include "xmltok_impl.c"
+#undef XML_TOK_IMPL_C
#undef MINBPC
#undef BYTE_TYPE
@@ -831,7 +837,9 @@
#define IS_NMSTRT_CHAR(enc, p, n) (0)
#define IS_NMSTRT_CHAR_MINBPC(enc, p) BIG2_IS_NMSTRT_CHAR_MINBPC(enc, p)
+#define XML_TOK_IMPL_C
#include "xmltok_impl.c"
+#undef XML_TOK_IMPL_C
#undef MINBPC
#undef BYTE_TYPE
@@ -1337,7 +1345,7 @@
ENCODING *
XmlInitUnknownEncoding(void *mem,
int *table,
- CONVERTER convert,
+ CONVERTER convert,
void *userData)
{
int i;
@@ -1610,7 +1618,9 @@
#define NS(x) x
#define ns(x) x
+#define XML_TOK_NS_C
#include "xmltok_ns.c"
+#undef XML_TOK_NS_C
#undef NS
#undef ns
@@ -1619,7 +1629,9 @@
#define NS(x) x ## NS
#define ns(x) x ## _ns
+#define XML_TOK_NS_C
#include "xmltok_ns.c"
+#undef XML_TOK_NS_C
#undef NS
#undef ns
@@ -1627,7 +1639,7 @@
ENCODING *
XmlInitUnknownEncodingNS(void *mem,
int *table,
- CONVERTER convert,
+ CONVERTER convert,
void *userData)
{
ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData);