mirror of https://github.com/python/cpython
gh-115399: Upgrade bundled libexpat to 2.6.0 (#115431)
This commit is contained in:
parent
671360161f
commit
4b2d1786cc
|
@ -0,0 +1 @@
|
|||
Update bundled libexpat to 2.6.0
|
|
@ -48,29 +48,15 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "ab7bb32514d170592dfb3f76e41bbdc075a4e7e0"
|
||||
"checksumValue": "90c06411f131e777e2b5c3d22b7ccf50bc46f617"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "f521acdad222644365b0e81a33bcd6939a98c91b225c47582cc84bd73d96febc"
|
||||
"checksumValue": "3045f9176950aa13a54e53fa096385670c676c492705d636e977f888e4c72d48"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/expat.h"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-FILE-Modules-expat-expat-config.h",
|
||||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "73627287302ee3e84347c4fe21f37a9cb828bc3b"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "f17e59f9d95eeb05694c02508aa284d332616c22cbe2e6a802d8a0710310eaab"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/expat_config.h"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-FILE-Modules-expat-expat-external.h",
|
||||
"checksums": [
|
||||
|
@ -104,11 +90,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "2790d37e7de2f13dccc4f4fb352cbdf9ed6abaa2"
|
||||
"checksumValue": "9f6d9211a7b627785d5c48d10cc8eda66255113f"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "d2efe5a1018449968a689f444cca432e3d5875aba6ad08ee18ca235d64f41bb9"
|
||||
"checksumValue": "9f0bdd346dd94ac4359c636a4e60bc768f4ae53ce0e836eb05fb9246ee36c7f2"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/internal.h"
|
||||
|
@ -160,11 +146,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "2b984f806f10fbfbf72d8d1b7ba2992413c15299"
|
||||
"checksumValue": "4c49b5df2bc702f663ba3b5a52d1940ec363226b"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "fbce56cd680e690043bbf572188cc2d0a25dbfc0d47ac8cb98eb3de768d4e694"
|
||||
"checksumValue": "b5ec29f6560acc183f1ee8ab92bb3aea17b87b4c2120cd2e3f78deba7a12491e"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/siphash.h"
|
||||
|
@ -188,11 +174,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "e774ae6ee9391aa6ffb8f775fb74e48f4b428959"
|
||||
"checksumValue": "a3a8c44efd55dbf2cfea8fcee009ec63120ec0a3"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "3c71cea9a6174718542331971a35db317902b2433be9d8dd1cb24239b635c0cc"
|
||||
"checksumValue": "e70948500d34dfcba4e9f0b305319dfe2a937c7cbfb687905128b56e1a6f8b33"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/winconfig.h"
|
||||
|
@ -202,11 +188,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "b580e827e16baa6b035586ffcd4d90301e5a353f"
|
||||
"checksumValue": "3b5de0ed1de33cad85b46230707403247f2851df"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "483518bbd69338eefc706cd7fc0b6039df2d3e347f64097989059ed6d2385a1e"
|
||||
"checksumValue": "a03abd531601eef61a87e06113d218ff139b6969e15a3d4668cd85d65fc6f79b"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/xmlparse.c"
|
||||
|
@ -216,11 +202,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "5ef21312af73deb2428be3fe97a65244608e76de"
|
||||
"checksumValue": "ef767128d2dda99436712dcf3465dde5dbaab876"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "6fcf8c72ac0112c1b98bd2039c632a66b4c3dc516ce7c1f981390951121ef3c0"
|
||||
"checksumValue": "71fb52aa302cf6f56e41943009965804f49ff2210d9bd15b258f70aaf70db772"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/xmlrole.c"
|
||||
|
@ -230,11 +216,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "c1a4ea6356643d0820edb9c024c20ad2aaf562dc"
|
||||
"checksumValue": "c961fb1a80f7b0601a63e69fba793fe5f6dff157"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "2b5d674be6ef20c7e3f69295176d75e68c5616e4dfce0a186fdd5e2ed8315f7a"
|
||||
"checksumValue": "228470eb9181a9a7575b63137edcb61b817ee4e0923faffdbeba29e07c939713"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/xmlrole.h"
|
||||
|
@ -244,11 +230,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "e6d66ae9fd61d7950c62c5d87693c30a707e8577"
|
||||
"checksumValue": "8394790c0199c8f88108542ad78f23095d28a3fe"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "1110f651bdccfa765ad3d6f3857a35887ab35fc0fe7f3f3488fde2b238b482e3"
|
||||
"checksumValue": "5b16c671ccc42496374762768e4bf48f614aecfd2025a07925b8d94244aec645"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/xmltok.c"
|
||||
|
@ -258,11 +244,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "9c2a544875fd08ba9c2397296c97263518a410aa"
|
||||
"checksumValue": "7d2943a0128094455004b1a98007b98734221bae"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "4299a03828b98bfe47ec6809f6e279252954a9a911dc7e0f19551bd74e3af971"
|
||||
"checksumValue": "6b8919dc951606dc6f2b0175f8955a9ced901ce8bd08db47f291b6c04227ae7f"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/xmltok.h"
|
||||
|
@ -272,11 +258,11 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA1",
|
||||
"checksumValue": "aa96882de8e3d1d3083124b595aa911efe44e5ad"
|
||||
"checksumValue": "7756f7c0d3625ae7dde6cf7d386685ffacb57c7e"
|
||||
},
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "0fbcba7931707c60301305dab78d2298d96447d0a5513926d8b18135228c0818"
|
||||
"checksumValue": "a3fe18ff32b21fbcb7c190895c68158404e1b9fb449db6431bc08b261dc03938"
|
||||
}
|
||||
],
|
||||
"fileName": "Modules/expat/xmltok_impl.c"
|
||||
|
@ -1590,14 +1576,14 @@
|
|||
"checksums": [
|
||||
{
|
||||
"algorithm": "SHA256",
|
||||
"checksumValue": "6b902ab103843592be5e99504f846ec109c1abb692e85347587f237a4ffa1033"
|
||||
"checksumValue": "a13447b9aa67d7c860783fdf6820f33ebdea996900d6d8bbc50a628f55f099f7"
|
||||
}
|
||||
],
|
||||
"downloadLocation": "https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.gz",
|
||||
"downloadLocation": "https://github.com/libexpat/libexpat/releases/download/R_2_6_0/expat-2.6.0.tar.gz",
|
||||
"externalRefs": [
|
||||
{
|
||||
"referenceCategory": "SECURITY",
|
||||
"referenceLocator": "cpe:2.3:a:libexpat_project:libexpat:2.5.0:*:*:*:*:*:*:*",
|
||||
"referenceLocator": "cpe:2.3:a:libexpat_project:libexpat:2.6.0:*:*:*:*:*:*:*",
|
||||
"referenceType": "cpe23Type"
|
||||
}
|
||||
],
|
||||
|
@ -1605,7 +1591,7 @@
|
|||
"name": "expat",
|
||||
"originator": "Organization: Expat development team",
|
||||
"primaryPackagePurpose": "SOURCE",
|
||||
"versionInfo": "2.5.0"
|
||||
"versionInfo": "2.6.0"
|
||||
},
|
||||
{
|
||||
"SPDXID": "SPDXRef-PACKAGE-hacl-star",
|
||||
|
@ -2368,11 +2354,6 @@
|
|||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-PACKAGE-expat"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-FILE-Modules-expat-expat-config.h",
|
||||
"relationshipType": "CONTAINS",
|
||||
"spdxElementId": "SPDXRef-PACKAGE-expat"
|
||||
},
|
||||
{
|
||||
"relatedSpdxElement": "SPDXRef-FILE-Modules-expat-expat-external.h",
|
||||
"relationshipType": "CONTAINS",
|
||||
|
|
|
@ -11,11 +11,13 @@
|
|||
Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2022 Thijs Schreijer <thijs@thijsschreijer.nl>
|
||||
Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
|
||||
Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
@ -269,7 +271,7 @@ XML_ParserCreate_MM(const XML_Char *encoding,
|
|||
const XML_Memory_Handling_Suite *memsuite,
|
||||
const XML_Char *namespaceSeparator);
|
||||
|
||||
/* Prepare a parser object to be re-used. This is particularly
|
||||
/* Prepare a parser object to be reused. This is particularly
|
||||
valuable when memory allocation overhead is disproportionately high,
|
||||
such as when a large number of small documnents need to be parsed.
|
||||
All handlers are cleared from the parser, except for the
|
||||
|
@ -951,7 +953,7 @@ XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
|
|||
XMLPARSEAPI(int)
|
||||
XML_GetCurrentByteCount(XML_Parser parser);
|
||||
|
||||
/* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
|
||||
/* If XML_CONTEXT_BYTES is >=1, returns the input buffer, sets
|
||||
the integer pointed to by offset to the offset within this buffer
|
||||
of the current parse position, and sets the integer pointed to by size
|
||||
to the size of this buffer (the number of input bytes). Otherwise
|
||||
|
@ -1025,7 +1027,9 @@ enum XML_FeatureEnum {
|
|||
XML_FEATURE_ATTR_INFO,
|
||||
/* Added in Expat 2.4.0. */
|
||||
XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
|
||||
XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT
|
||||
XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
|
||||
/* Added in Expat 2.6.0. */
|
||||
XML_FEATURE_GE
|
||||
/* Additional features must be added to the end of this enum. */
|
||||
};
|
||||
|
||||
|
@ -1038,23 +1042,29 @@ typedef struct {
|
|||
XMLPARSEAPI(const XML_Feature *)
|
||||
XML_GetFeatureList(void);
|
||||
|
||||
#ifdef XML_DTD
|
||||
/* Added in Expat 2.4.0. */
|
||||
#if XML_GE == 1
|
||||
/* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
* added in Expat 2.6.0 for XML_GE == 1. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetBillionLaughsAttackProtectionMaximumAmplification(
|
||||
XML_Parser parser, float maximumAmplificationFactor);
|
||||
|
||||
/* Added in Expat 2.4.0. */
|
||||
/* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
* added in Expat 2.6.0 for XML_GE == 1. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetBillionLaughsAttackProtectionActivationThreshold(
|
||||
XML_Parser parser, unsigned long long activationThresholdBytes);
|
||||
#endif
|
||||
|
||||
/* Added in Expat 2.6.0. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
|
||||
|
||||
/* Expat follows the semantic versioning convention.
|
||||
See http://semver.org.
|
||||
See https://semver.org
|
||||
*/
|
||||
#define XML_MAJOR_VERSION 2
|
||||
#define XML_MINOR_VERSION 5
|
||||
#define XML_MINOR_VERSION 6
|
||||
#define XML_MICRO_VERSION 0
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#define XML_NS 1
|
||||
#define XML_DTD 1
|
||||
#define XML_GE 1
|
||||
#define XML_CONTEXT_BYTES 1024
|
||||
|
||||
// bpo-30947: Python uses best available entropy sources to
|
||||
|
|
|
@ -28,9 +28,10 @@
|
|||
Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
@ -154,12 +155,15 @@ extern "C" {
|
|||
void _INTERNAL_trim_to_complete_utf8_characters(const char *from,
|
||||
const char **fromLimRef);
|
||||
|
||||
#if defined(XML_DTD)
|
||||
#if XML_GE == 1
|
||||
unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser);
|
||||
unsigned long long testingAccountingGetCountBytesIndirect(XML_Parser parser);
|
||||
const char *unsignedCharToPrintable(unsigned char c);
|
||||
#endif
|
||||
|
||||
extern XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c
|
||||
extern unsigned int g_parseAttempts; // used for testing only
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
* if this code is included and compiled as C++; related GCC warning is:
|
||||
* warning: use of C++11 long long integer constant [-Wlong-long]
|
||||
*/
|
||||
#define _SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low))
|
||||
#define SIP_ULL(high, low) ((((uint64_t)high) << 32) | (low))
|
||||
|
||||
#define SIP_ROTL(x, b) (uint64_t)(((x) << (b)) | ((x) >> (64 - (b))))
|
||||
|
||||
|
@ -190,10 +190,10 @@ sip_round(struct siphash *H, const int rounds) {
|
|||
|
||||
static struct siphash *
|
||||
sip24_init(struct siphash *H, const struct sipkey *key) {
|
||||
H->v0 = _SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
|
||||
H->v1 = _SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
|
||||
H->v2 = _SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
|
||||
H->v3 = _SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
|
||||
H->v0 = SIP_ULL(0x736f6d65U, 0x70736575U) ^ key->k[0];
|
||||
H->v1 = SIP_ULL(0x646f7261U, 0x6e646f6dU) ^ key->k[1];
|
||||
H->v2 = SIP_ULL(0x6c796765U, 0x6e657261U) ^ key->k[0];
|
||||
H->v3 = SIP_ULL(0x74656462U, 0x79746573U) ^ key->k[1];
|
||||
|
||||
H->p = H->buf;
|
||||
H->c = 0;
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2005 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017-2023 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2023 Orgad Shaneh <orgad.shaneh@audiocodes.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
@ -35,7 +36,9 @@
|
|||
#ifndef WINCONFIG_H
|
||||
#define WINCONFIG_H
|
||||
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -12,10 +12,10 @@
|
|||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2005-2009 Steven Solie <steven@solie.ca>
|
||||
Copyright (c) 2016-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2023 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
Copyright (c) 2021 Dong-hee Na <donghee.na@python.org>
|
||||
Copyright (c) 2021 Donghee Na <donghee.na@python.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
@ -38,7 +38,7 @@
|
|||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <expat_config.h>
|
||||
#include "expat_config.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
@ -127,9 +127,9 @@ typedef struct prolog_state {
|
|||
#endif /* XML_DTD */
|
||||
} PROLOG_STATE;
|
||||
|
||||
void XmlPrologStateInit(PROLOG_STATE *);
|
||||
void XmlPrologStateInit(PROLOG_STATE *state);
|
||||
#ifdef XML_DTD
|
||||
void XmlPrologStateInitExternalEntity(PROLOG_STATE *);
|
||||
void XmlPrologStateInitExternalEntity(PROLOG_STATE *state);
|
||||
#endif /* XML_DTD */
|
||||
|
||||
#define XmlTokenRole(state, tok, ptr, end, enc) \
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
Copyright (c) 2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2005-2009 Steven Solie <steven@solie.ca>
|
||||
Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016 Pascal Cuoq <cuoq@trust-in-soft.com>
|
||||
Copyright (c) 2016 Don Lewis <truckman@apache.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
|
@ -20,8 +20,10 @@
|
|||
Copyright (c) 2017 Benbuck Nason <bnason@netflix.com>
|
||||
Copyright (c) 2017 José Gutiérrez de la Concha <jose@zeroc.com>
|
||||
Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
Copyright (c) 2021 Dong-hee Na <donghee.na@python.org>
|
||||
Copyright (c) 2021 Donghee Na <donghee.na@python.org>
|
||||
Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
|
||||
Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
|
||||
Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
@ -44,7 +46,7 @@
|
|||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <expat_config.h>
|
||||
#include "expat_config.h"
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h> /* memcpy */
|
||||
|
@ -100,7 +102,7 @@
|
|||
& (1u << (((byte)[2]) & 0x1F)))
|
||||
|
||||
/* Detection of invalid UTF-8 sequences is based on Table 3.1B
|
||||
of Unicode 3.2: http://www.unicode.org/unicode/reports/tr28/
|
||||
of Unicode 3.2: https://www.unicode.org/unicode/reports/tr28/
|
||||
with the additional restriction of not allowing the Unicode
|
||||
code points 0xFFFF and 0xFFFE (sequences EF,BF,BF and EF,BF,BE).
|
||||
Implementation details:
|
||||
|
@ -225,7 +227,7 @@ struct normal_encoding {
|
|||
/* isNmstrt2 */ NULL, /* isNmstrt3 */ NULL, /* isNmstrt4 */ NULL, \
|
||||
/* isInvalid2 */ NULL, /* isInvalid3 */ NULL, /* isInvalid4 */ NULL
|
||||
|
||||
static int FASTCALL checkCharRefNumber(int);
|
||||
static int FASTCALL checkCharRefNumber(int result);
|
||||
|
||||
#include "xmltok_impl.h"
|
||||
#include "ascii.h"
|
||||
|
@ -243,7 +245,7 @@ static int FASTCALL checkCharRefNumber(int);
|
|||
#endif
|
||||
|
||||
#define SB_BYTE_TYPE(enc, p) \
|
||||
(((struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
|
||||
(((const struct normal_encoding *)(enc))->type[(unsigned char)*(p)])
|
||||
|
||||
#ifdef XML_MIN_SIZE
|
||||
static int PTRFASTCALL
|
||||
|
@ -407,7 +409,7 @@ utf8_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim,
|
|||
unsigned short *to = *toP;
|
||||
const char *from = *fromP;
|
||||
while (from < fromLim && to < toLim) {
|
||||
switch (((struct normal_encoding *)enc)->type[(unsigned char)*from]) {
|
||||
switch (SB_BYTE_TYPE(enc, from)) {
|
||||
case BT_LEAD2:
|
||||
if (fromLim - from < 2) {
|
||||
res = XML_CONVERT_INPUT_INCOMPLETE;
|
||||
|
@ -715,31 +717,26 @@ unicode_byte_type(char hi, char lo) {
|
|||
return res; \
|
||||
}
|
||||
|
||||
#define SET2(ptr, ch) (((ptr)[0] = ((ch)&0xff)), ((ptr)[1] = ((ch) >> 8)))
|
||||
#define GET_LO(ptr) ((unsigned char)(ptr)[0])
|
||||
#define GET_HI(ptr) ((unsigned char)(ptr)[1])
|
||||
|
||||
DEFINE_UTF16_TO_UTF8(little2_)
|
||||
DEFINE_UTF16_TO_UTF16(little2_)
|
||||
|
||||
#undef SET2
|
||||
#undef GET_LO
|
||||
#undef GET_HI
|
||||
|
||||
#define SET2(ptr, ch) (((ptr)[0] = ((ch) >> 8)), ((ptr)[1] = ((ch)&0xFF)))
|
||||
#define GET_LO(ptr) ((unsigned char)(ptr)[1])
|
||||
#define GET_HI(ptr) ((unsigned char)(ptr)[0])
|
||||
|
||||
DEFINE_UTF16_TO_UTF8(big2_)
|
||||
DEFINE_UTF16_TO_UTF16(big2_)
|
||||
|
||||
#undef SET2
|
||||
#undef GET_LO
|
||||
#undef GET_HI
|
||||
|
||||
#define LITTLE2_BYTE_TYPE(enc, p) \
|
||||
((p)[1] == 0 ? ((struct normal_encoding *)(enc))->type[(unsigned char)*(p)] \
|
||||
: unicode_byte_type((p)[1], (p)[0]))
|
||||
((p)[1] == 0 ? SB_BYTE_TYPE(enc, p) : unicode_byte_type((p)[1], (p)[0]))
|
||||
#define LITTLE2_BYTE_TO_ASCII(p) ((p)[1] == 0 ? (p)[0] : -1)
|
||||
#define LITTLE2_CHAR_MATCHES(p, c) ((p)[1] == 0 && (p)[0] == (c))
|
||||
#define LITTLE2_IS_NAME_CHAR_MINBPC(p) \
|
||||
|
@ -872,9 +869,7 @@ static const struct normal_encoding internal_little2_encoding
|
|||
#endif
|
||||
|
||||
#define BIG2_BYTE_TYPE(enc, p) \
|
||||
((p)[0] == 0 \
|
||||
? ((struct normal_encoding *)(enc))->type[(unsigned char)(p)[1]] \
|
||||
: unicode_byte_type((p)[0], (p)[1]))
|
||||
((p)[0] == 0 ? SB_BYTE_TYPE(enc, p + 1) : unicode_byte_type((p)[0], (p)[1]))
|
||||
#define BIG2_BYTE_TO_ASCII(p) ((p)[0] == 0 ? (p)[1] : -1)
|
||||
#define BIG2_CHAR_MATCHES(p, c) ((p)[0] == 0 && (p)[1] == (c))
|
||||
#define BIG2_IS_NAME_CHAR_MINBPC(p) \
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2002-2005 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016-2017 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Licensed under the MIT license:
|
||||
|
||||
|
@ -289,7 +289,8 @@ int XmlParseXmlDecl(int isGeneralTextEntity, const ENCODING *enc,
|
|||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr, int *standalonePtr);
|
||||
|
||||
int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
|
||||
int XmlInitEncoding(INIT_ENCODING *p, const ENCODING **encPtr,
|
||||
const char *name);
|
||||
const ENCODING *XmlGetUtf8InternalEncoding(void);
|
||||
const ENCODING *XmlGetUtf16InternalEncoding(void);
|
||||
int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
|
||||
|
@ -307,7 +308,8 @@ int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc,
|
|||
const char **encodingNamePtr,
|
||||
const ENCODING **namedEncodingPtr, int *standalonePtr);
|
||||
|
||||
int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
|
||||
int XmlInitEncodingNS(INIT_ENCODING *p, const ENCODING **encPtr,
|
||||
const char *name);
|
||||
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
|
||||
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
|
||||
ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
|
||||
|
|
|
@ -59,7 +59,10 @@ PACKAGE_TO_FILES = {
|
|||
include=["Modules/_decimal/libmpdec/**"]
|
||||
),
|
||||
"expat": PackageFiles(
|
||||
include=["Modules/expat/**"]
|
||||
include=["Modules/expat/**"],
|
||||
exclude=[
|
||||
"Modules/expat/expat_config.h",
|
||||
]
|
||||
),
|
||||
"macholib": PackageFiles(
|
||||
include=["Lib/ctypes/macholib/**"],
|
||||
|
|
|
@ -104,6 +104,7 @@ EXCLUDED += clean_lines('''
|
|||
# The problem with xmlparse.c is that something
|
||||
# has gone wrong where # we handle "maybe inline actual"
|
||||
# in Tools/c-analyzer/c_parser/parser/_global.py.
|
||||
Modules/expat/internal.h
|
||||
Modules/expat/xmlparse.c
|
||||
''')
|
||||
|
||||
|
|
Loading…
Reference in New Issue