Skip to content

Commit 62eac34

Browse files
Update bundled expat to 2.8.2
1 parent 55bc312 commit 62eac34

15 files changed

Lines changed: 857 additions & 572 deletions

Makefile.pre.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,13 +621,16 @@ LIBEXPAT_HEADERS= \
621621
Modules/expat/expat.h \
622622
Modules/expat/expat_config.h \
623623
Modules/expat/expat_external.h \
624+
Modules/expat/fallthrough.h \
624625
Modules/expat/iasciitab.h \
625626
Modules/expat/internal.h \
626627
Modules/expat/latin1tab.h \
628+
Modules/expat/memory_sanitizer.h \
627629
Modules/expat/nametab.h \
628630
Modules/expat/pyexpatns.h \
629631
Modules/expat/siphash.h \
630632
Modules/expat/utf8tab.h \
633+
Modules/expat/xcsinc.c \
631634
Modules/expat/xmlrole.h \
632635
Modules/expat/xmltok.h \
633636
Modules/expat/xmltok_impl.h \
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update bundled `libexpat <https://libexpat.github.io/>`_ to version 2.8.2.

Modules/expat/expat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
10941094
*/
10951095
# define XML_MAJOR_VERSION 2
10961096
# define XML_MINOR_VERSION 8
1097-
# define XML_MICRO_VERSION 1
1097+
# define XML_MICRO_VERSION 2
10981098

10991099
# ifdef __cplusplus
11001100
}

Modules/expat/fallthrough.h

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/*
2+
__ __ _
3+
___\ \/ /_ __ __ _| |_
4+
/ _ \\ /| '_ \ / _` | __|
5+
| __// \| |_) | (_| | |_
6+
\___/_/\_\ .__/ \__,_|\__|
7+
|_| XML parser
8+
9+
Copyright (c) 2026 Nick Begg <nick@stunttruck.net>
10+
Licensed under the MIT license:
11+
12+
Permission is hereby granted, free of charge, to any person obtaining
13+
a copy of this software and associated documentation files (the
14+
"Software"), to deal in the Software without restriction, including
15+
without limitation the rights to use, copy, modify, merge, publish,
16+
distribute, sublicense, and/or sell copies of the Software, and to permit
17+
persons to whom the Software is furnished to do so, subject to the
18+
following conditions:
19+
20+
The above copyright notice and this permission notice shall be included
21+
in all copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
26+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29+
USE OR OTHER DEALINGS IN THE SOFTWARE.
30+
*/
31+
32+
#ifndef FALLTHROUGH_H
33+
# define FALLTHROUGH_H 1
34+
35+
// Explicit fallthrough in switch case to avoid warnings
36+
// with compiler flag -Wimplicit-fallthrough.
37+
38+
# define EXPAT_FALLTHROUGH \
39+
do { \
40+
} while (0)
41+
42+
# if defined(__has_attribute)
43+
# if __has_attribute(fallthrough)
44+
# undef EXPAT_FALLTHROUGH
45+
# define EXPAT_FALLTHROUGH __attribute__((fallthrough))
46+
# endif
47+
# endif
48+
49+
#endif // FALLTHROUGH_H

Modules/expat/memory_sanitizer.h

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
__ __ _
3+
___\ \/ /_ __ __ _| |_
4+
/ _ \\ /| '_ \ / _` | __|
5+
| __// \| |_) | (_| | |_
6+
\___/_/\_\ .__/ \__,_|\__|
7+
|_| XML parser
8+
9+
Copyright (c) 2026 Matthew Fernandez <matthew.fernandez@gmail.com>
10+
Licensed under the MIT license:
11+
12+
Permission is hereby granted, free of charge, to any person obtaining
13+
a copy of this software and associated documentation files (the
14+
"Software"), to deal in the Software without restriction, including
15+
without limitation the rights to use, copy, modify, merge, publish,
16+
distribute, sublicense, and/or sell copies of the Software, and to permit
17+
persons to whom the Software is furnished to do so, subject to the
18+
following conditions:
19+
20+
The above copyright notice and this permission notice shall be included
21+
in all copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
26+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29+
USE OR OTHER DEALINGS IN THE SOFTWARE.
30+
*/
31+
32+
#if ! defined(MEMORY_SANITIZER_H)
33+
# define MEMORY_SANITIZER_H 1
34+
35+
# if defined(__has_feature)
36+
# if __has_feature(memory_sanitizer)
37+
# include <sanitizer/msan_interface.h>
38+
39+
// inform Memory Sanitizer that [base, base + extent) is now initialized
40+
# define MSAN_UNPOISON(base, extent) __msan_unpoison((base), (extent))
41+
42+
# endif
43+
# endif
44+
45+
# if ! defined(MSAN_UNPOISON)
46+
# define MSAN_UNPOISON(base, extent) \
47+
do { \
48+
} while (0)
49+
# endif
50+
51+
#endif // ! defined(MEMORY_SANITIZER_H)

Modules/expat/refresh.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ fi
1212

1313
# Update this when updating to a new version after verifying that the changes
1414
# the update brings in are good. These values are used for verifying the SBOM, too.
15-
expected_libexpat_tag="R_2_8_1"
16-
expected_libexpat_version="2.8.1"
17-
expected_libexpat_sha256="a52eb72108be160e190b5cafa5bba8663f1313f2013e26060d1c18e26e31067b"
15+
expected_libexpat_tag="R_2_8_2"
16+
expected_libexpat_version="2.8.2"
17+
expected_libexpat_sha256="ef7d1994f533c9e7343d6c19f31064fc8ebbcbcaa144be3812b4f43052a05f4c"
1818

1919
expat_dir="$(realpath "$(dirname -- "${BASH_SOURCE[0]}")")"
2020
cd ${expat_dir}
@@ -33,13 +33,16 @@ lib_files=(
3333
asciitab.h
3434
expat.h
3535
expat_external.h
36+
fallthrough.h
3637
iasciitab.h
3738
internal.h
3839
latin1tab.h
40+
memory_sanitizer.h
3941
nametab.h
4042
siphash.h
4143
utf8tab.h
4244
winconfig.h
45+
xcsinc.c
4346
xmlparse.c
4447
xmlrole.c
4548
xmlrole.h

Modules/expat/siphash.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100

101101
#include <stddef.h> /* size_t */
102102
#include <stdint.h> /* uint64_t uint32_t uint8_t */
103+
#include "fallthrough.h"
103104

104105
/*
105106
* Workaround to not require a C++11 compiler for using ULL suffix
@@ -234,25 +235,25 @@ sip24_final(struct siphash *H) {
234235
switch (left) {
235236
case 7:
236237
b |= (uint64_t)H->buf[6] << 48;
237-
/* fall through */
238+
EXPAT_FALLTHROUGH;
238239
case 6:
239240
b |= (uint64_t)H->buf[5] << 40;
240-
/* fall through */
241+
EXPAT_FALLTHROUGH;
241242
case 5:
242243
b |= (uint64_t)H->buf[4] << 32;
243-
/* fall through */
244+
EXPAT_FALLTHROUGH;
244245
case 4:
245246
b |= (uint64_t)H->buf[3] << 24;
246-
/* fall through */
247+
EXPAT_FALLTHROUGH;
247248
case 3:
248249
b |= (uint64_t)H->buf[2] << 16;
249-
/* fall through */
250+
EXPAT_FALLTHROUGH;
250251
case 2:
251252
b |= (uint64_t)H->buf[1] << 8;
252-
/* fall through */
253+
EXPAT_FALLTHROUGH;
253254
case 1:
254255
b |= (uint64_t)H->buf[0] << 0;
255-
/* fall through */
256+
EXPAT_FALLTHROUGH;
256257
case 0:
257258
break;
258259
}

Modules/expat/xcsinc.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* This file is included from other .c files!
2+
__ __ _
3+
___\ \/ /_ __ __ _| |_
4+
/ _ \\ /| '_ \ / _` | __|
5+
| __// \| |_) | (_| | |_
6+
\___/_/\_\ .__/ \__,_|\__|
7+
|_| XML parser
8+
9+
Copyright (c) 2022 Sebastian Pipping <sebastian@pipping.org>
10+
Licensed under the MIT license:
11+
12+
Permission is hereby granted, free of charge, to any person obtaining
13+
a copy of this software and associated documentation files (the
14+
"Software"), to deal in the Software without restriction, including
15+
without limitation the rights to use, copy, modify, merge, publish,
16+
distribute, sublicense, and/or sell copies of the Software, and to permit
17+
persons to whom the Software is furnished to do so, subject to the
18+
following conditions:
19+
20+
The above copyright notice and this permission notice shall be included
21+
in all copies or substantial portions of the Software.
22+
23+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
26+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
27+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
28+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
29+
USE OR OTHER DEALINGS IN THE SOFTWARE.
30+
*/
31+
32+
static size_t
33+
xcslen(const XML_Char *s) {
34+
#ifdef XML_UNICODE
35+
# ifdef XML_UNICODE_WCHAR_T
36+
return wcslen(s);
37+
# else
38+
// XML_Char is unsigned short
39+
size_t len = 0;
40+
while (s[len]) {
41+
len++;
42+
}
43+
return len;
44+
# endif
45+
#else
46+
return strlen(s);
47+
#endif
48+
}

0 commit comments

Comments
 (0)