Skip to content

Commit 9381e6b

Browse files
committed
chore(XML): #4477: Upgrade bundled libexpat to 2.6.1
1 parent 3eac142 commit 9381e6b

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
lines changed

XML/include/Poco/XML/expat.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Copyright (c) 2022 Thijs Schreijer <[email protected]>
1919
Copyright (c) 2023 Hanno Böck <[email protected]>
2020
Copyright (c) 2023 Sony Corporation / Snild Dolkow <[email protected]>
21+
Copyright (c) 2024 Taichi Haradaguchi <[email protected]>
2122
Licensed under the MIT license:
2223
2324
Permission is hereby granted, free of charge, to any person obtaining
@@ -1042,7 +1043,7 @@ typedef struct {
10421043
XMLPARSEAPI(const XML_Feature *)
10431044
XML_GetFeatureList(void);
10441045

1045-
#if XML_GE == 1
1046+
#if defined(XML_DTD) || (defined(XML_GE) && XML_GE == 1)
10461047
/* Added in Expat 2.4.0 for XML_DTD defined and
10471048
* added in Expat 2.6.0 for XML_GE == 1. */
10481049
XMLPARSEAPI(XML_Bool)
@@ -1065,7 +1066,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
10651066
*/
10661067
#define XML_MAJOR_VERSION 2
10671068
#define XML_MINOR_VERSION 6
1068-
#define XML_MICRO_VERSION 0
1069+
#define XML_MICRO_VERSION 1
10691070

10701071
#ifdef __cplusplus
10711072
}

XML/src/internal.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@
2828
Copyright (c) 2002-2003 Fred L. Drake, Jr. <[email protected]>
2929
Copyright (c) 2002-2006 Karl Waclawek <[email protected]>
3030
Copyright (c) 2003 Greg Stein <[email protected]>
31-
Copyright (c) 2016-2023 Sebastian Pipping <[email protected]>
31+
Copyright (c) 2016-2024 Sebastian Pipping <[email protected]>
3232
Copyright (c) 2018 Yury Gribov <[email protected]>
3333
Copyright (c) 2019 David Loffredo <[email protected]>
34-
Copyright (c) 2023 Sony Corporation / Snild Dolkow <[email protected]>
34+
Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <[email protected]>
35+
Copyright (c) 2024 Taichi Haradaguchi <[email protected]>
3536
Licensed under the MIT license:
3637
3738
Permission is hereby granted, free of charge, to any person obtaining
@@ -155,14 +156,20 @@ extern "C" {
155156
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
156157
const char **fromLimRef);
157158

158-
#if XML_GE == 1
159+
#if defined(XML_GE) && XML_GE == 1
159160
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
160161
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
161162
const char *unsignedCharToPrintable(unsigned char c);
162163
#endif
163164

164-
extern XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c
165-
extern unsigned int g_parseAttempts; // used for testing only
165+
extern
166+
#if ! defined(XML_TESTING)
167+
const
168+
#endif
169+
XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c
170+
#if defined(XML_TESTING)
171+
extern unsigned int g_bytesScanned; // used for testing only
172+
#endif
166173

167174
#ifdef __cplusplus
168175
}

XML/src/xmlparse.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* 628e24d4966bedbd4800f6ed128d06d29703765b4bce12d3b7f099f90f842fc9 (2.6.0+)
1+
/* dd2a9703e301882afe16d198a82689ab225277057f5eab9d079d8606eab736b4 (2.6.1+)
22
__ __ _
33
___\ \/ /_ __ __ _| |_
44
/ _ \\ /| '_ \ / _` | __|
@@ -38,7 +38,7 @@
3838
Copyright (c) 2022 Jann Horn <[email protected]>
3939
Copyright (c) 2022 Sean McBride <[email protected]>
4040
Copyright (c) 2023 Owain Davies <[email protected]>
41-
Copyright (c) 2023 Sony Corporation / Snild Dolkow <[email protected]>
41+
Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <[email protected]>
4242
Licensed under the MIT license:
4343
4444
Permission is hereby granted, free of charge, to any person obtaining
@@ -217,7 +217,7 @@ typedef char ICHAR;
217217
#endif
218218

219219
/* Round up n to be a multiple of sz, where sz is a power of 2. */
220-
#define ROUND_UP(n, sz) (((n) + ((sz)-1)) & ~((sz)-1))
220+
#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
221221

222222
/* Do safe (NULL-aware) pointer arithmetic */
223223
#define EXPAT_SAFE_PTR_DIFF(p, q) (((p) && (q)) ? ((p) - (q)) : 0)
@@ -255,7 +255,7 @@ static void copy_salt_to_sipkey(XML_Parser parser, struct sipkey *key);
255255
it odd, since odd numbers are always relative prime to a power of 2.
256256
*/
257257
#define SECOND_HASH(hash, mask, power) \
258-
((((hash) & ~(mask)) >> ((power)-1)) & ((mask) >> 2))
258+
((((hash) & ~(mask)) >> ((power) - 1)) & ((mask) >> 2))
259259
#define PROBE_STEP(hash, mask, power) \
260260
((unsigned char)((SECOND_HASH(hash, mask, power)) | 1))
261261

@@ -636,8 +636,14 @@ static unsigned long getDebugLevel(const char *variableName,
636636
? 0 \
637637
: ((*((pool)->ptr)++ = c), 1))
638638

639-
XML_Bool g_reparseDeferralEnabledDefault = XML_TRUE; // write ONLY in runtests.c
640-
unsigned int g_parseAttempts = 0; // used for testing only
639+
#if ! defined(XML_TESTING)
640+
const
641+
#endif
642+
XML_Bool g_reparseDeferralEnabledDefault
643+
= XML_TRUE; // write ONLY in runtests.c
644+
#if defined(XML_TESTING)
645+
unsigned int g_bytesScanned = 0; // used for testing only
646+
#endif
641647

642648
struct XML_ParserStruct {
643649
/* The first member must be m_userData so that the XML_GetUserData
@@ -1035,7 +1041,9 @@ callProcessor(XML_Parser parser, const char *start, const char *end,
10351041
return XML_ERROR_NONE;
10361042
}
10371043
}
1038-
g_parseAttempts += 1;
1044+
#if defined(XML_TESTING)
1045+
g_bytesScanned += (unsigned)have_now;
1046+
#endif
10391047
const enum XML_Error ret = parser->m_processor(parser, start, end, endPtr);
10401048
if (ret == XML_ERROR_NONE) {
10411049
// if we consumed nothing, remember what we had on this parse attempt.

0 commit comments

Comments
 (0)