From 034eeaff9735e8a8f088861c166cf220d30c8e44 Mon Sep 17 00:00:00 2001 From: Job Bautista Date: Mon, 12 Jan 2026 08:33:33 +0800 Subject: [PATCH] Issue #2889 - Follow-up: Adjust Expat 2.7.3 local patches for removal of 3rd patch. --- parser/expat/04_always_set_eventptrs.patch | 2 +- parser/expat/05_getcurrentbyteindex.patch | 2 +- .../expat/06_report_processing_entity.patch | 2 +- parser/expat/07_always_store_rawnames.patch | 44 ++++++++-------- .../08_dont_ignore_undeclared_entity.patch | 4 +- parser/expat/09_include_xmlns.patch | 14 ++--- parser/expat/10_internalsubset.patch | 2 +- parser/expat/13_no_debug_report.patch | 43 +++++++++------ parser/expat/14_unused.patch | 52 +++++++++---------- parser/expat/15_mcp_2_7_3.patch | 10 ++-- 10 files changed, 94 insertions(+), 81 deletions(-) diff --git a/parser/expat/04_always_set_eventptrs.patch b/parser/expat/04_always_set_eventptrs.patch index f30cd6463b..7e8ce4b1be 100644 --- a/parser/expat/04_always_set_eventptrs.patch +++ b/parser/expat/04_always_set_eventptrs.patch @@ -1,7 +1,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -2744,6 +2744,10 @@ +@@ -2738,6 +2738,10 @@ XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr, parser->m_bufferPtr, &parser->m_position); parser->m_positionPtr = parser->m_bufferPtr; diff --git a/parser/expat/05_getcurrentbyteindex.patch b/parser/expat/05_getcurrentbyteindex.patch index 4e6ef95531..98478621ea 100644 --- a/parser/expat/05_getcurrentbyteindex.patch +++ b/parser/expat/05_getcurrentbyteindex.patch @@ -1,7 +1,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -2773,7 +2773,11 @@ +@@ -2767,7 +2767,11 @@ if (parser->m_eventPtr) return (XML_Index)(parser->m_parseEndByteIndex - (parser->m_parseEndPtr - parser->m_eventPtr)); diff --git a/parser/expat/06_report_processing_entity.patch b/parser/expat/06_report_processing_entity.patch index bc821c88a2..b6a781b1d7 100644 --- a/parser/expat/06_report_processing_entity.patch +++ b/parser/expat/06_report_processing_entity.patch @@ -1,7 +1,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -3131,12 +3131,20 @@ +@@ -3125,12 +3125,20 @@ } #endif /* XML_GE == 1 */ diff --git a/parser/expat/07_always_store_rawnames.patch b/parser/expat/07_always_store_rawnames.patch index 9d039dc04b..b4380f68a8 100644 --- a/parser/expat/07_always_store_rawnames.patch +++ b/parser/expat/07_always_store_rawnames.patch @@ -16,7 +16,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static enum XML_Error doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, const char *start, const char *end, const char **endPtr, -@@ -3217,10 +3225,12 @@ +@@ -3211,10 +3219,12 @@ parser, parser->m_parentParser ? 1 : 0, parser->m_encoding, start, end, endPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_ACCOUNT_DIRECT); @@ -29,44 +29,44 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c return result; } -@@ -3338,17 +3348,41 @@ +@@ -3332,6 +3342,23 @@ = doContent(parser, 1, parser->m_encoding, start, end, endPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_ACCOUNT_ENTITY_EXPANSION); +#ifndef MOZILLA_CLIENT /* Bug 1746996 - Ensure that storeRawNames is always called */ - if (result == XML_ERROR_NONE) { - if (! storeRawNames(parser)) - return XML_ERROR_NO_MEMORY; - } -+#endif - return result; - } - -+#ifdef MOZILLA_CLIENT -+/* Bug 1746996 - Ensure that storeRawNames is always called */ - static enum XML_Error - doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, - const char *s, const char *end, const char **nextPtr, - XML_Bool haveMore, enum XML_Account account) { -+ enum XML_Error result = doContentInternal(parser, startTagLevel, enc, s, end, -+ nextPtr, haveMore, account); + if (result == XML_ERROR_NONE) { + if (! storeRawNames(parser)) + return XML_ERROR_NO_MEMORY; + } ++#endif + return result; +} + ++#ifdef MOZILLA_CLIENT ++/* Bug 1746996 - Ensure that storeRawNames is always called */ ++static enum XML_Error ++doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, ++ const char *s, const char *end, const char **nextPtr, ++ XML_Bool haveMore, enum XML_Account account) { ++ enum XML_Error result = doContentInternal(parser, startTagLevel, enc, s, end, ++ nextPtr, haveMore, account); + if (result == XML_ERROR_NONE) { + if (! storeRawNames(parser)) + return XML_ERROR_NO_MEMORY; +@@ -3339,10 +3366,17 @@ + return result; + } + + +static enum XML_Error +doContentInternal(XML_Parser parser, int startTagLevel, const ENCODING *enc, + const char *s, const char *end, const char **nextPtr, + XML_Bool haveMore, enum XML_Account account) { +#else -+static enum XML_Error -+doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, -+ const char *s, const char *end, const char **nextPtr, -+ XML_Bool haveMore, enum XML_Account account) { + static enum XML_Error + doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc, + const char *s, const char *end, const char **nextPtr, + XML_Bool haveMore, enum XML_Account account) { +#endif /* MOZILLA_CLIENT */ /* save one level of indirection */ DTD *const dtd = parser->m_dtd; diff --git a/parser/expat/08_dont_ignore_undeclared_entity.patch b/parser/expat/08_dont_ignore_undeclared_entity.patch index e32f7e0668..e74d6e9844 100644 --- a/parser/expat/08_dont_ignore_undeclared_entity.patch +++ b/parser/expat/08_dont_ignore_undeclared_entity.patch @@ -1,7 +1,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -3498,9 +3498,14 @@ +@@ -3492,9 +3492,14 @@ } else if (! entity) { if (parser->m_skippedEntityHandler) parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0); @@ -16,7 +16,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c } if (entity->open) return XML_ERROR_RECURSIVE_ENTITY_REF; -@@ -6796,7 +6801,12 @@ +@@ -6790,7 +6795,12 @@ if ((pool == &parser->m_tempPool) && parser->m_defaultHandler) reportDefault(parser, enc, ptr, next); */ diff --git a/parser/expat/09_include_xmlns.patch b/parser/expat/09_include_xmlns.patch index d1803d571d..c67a9cc488 100644 --- a/parser/expat/09_include_xmlns.patch +++ b/parser/expat/09_include_xmlns.patch @@ -1,7 +1,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -3939,6 +3939,9 @@ +@@ -3933,6 +3933,9 @@ int n; XML_Char *uri; int nPrefixes = 0; @@ -11,7 +11,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c BINDING *binding; const XML_Char *localPart; -@@ -4096,7 +4099,13 @@ +@@ -4090,7 +4093,13 @@ appAtts[attIndex], bindingsPtr); if (result) return result; @@ -25,7 +25,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c } else { /* deal with other prefixed names later */ attIndex++; -@@ -4128,6 +4137,12 @@ +@@ -4122,6 +4131,12 @@ da->value, bindingsPtr); if (result) return result; @@ -38,7 +38,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c } else { (da->id->name)[-1] = 2; nPrefixes++; -@@ -4146,7 +4161,11 @@ +@@ -4140,7 +4155,11 @@ /* expand prefixed attribute names, check for duplicates, and clear flags that say whether attributes were specified */ i = 0; @@ -50,7 +50,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c unsigned int j; /* hash table index */ unsigned long version = parser->m_nsAttsVersion; -@@ -4156,6 +4175,9 @@ +@@ -4150,6 +4169,9 @@ } unsigned int nsAttsSize = 1u << parser->m_nsAttsPower; @@ -60,7 +60,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c unsigned char oldNsAttsPower = parser->m_nsAttsPower; /* size of hash table must be at least 2 * (# of prefixed attributes) */ if ((nPrefixes << 1) -@@ -4204,6 +4226,9 @@ +@@ -4198,6 +4220,9 @@ parser->m_nsAtts[--j].version = version; } parser->m_nsAttsVersion = --version; @@ -70,7 +70,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c /* expand prefixed names and check for duplicates */ for (; i < attIndex; i += 2) { -@@ -4303,10 +4328,61 @@ +@@ -4297,10 +4322,61 @@ parser->m_nsAtts[j].hash = uriHash; parser->m_nsAtts[j].uriName = s; diff --git a/parser/expat/10_internalsubset.patch b/parser/expat/10_internalsubset.patch index c5aab60d24..dafc8ca4a8 100644 --- a/parser/expat/10_internalsubset.patch +++ b/parser/expat/10_internalsubset.patch @@ -1,7 +1,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -6231,7 +6231,11 @@ +@@ -6225,7 +6225,11 @@ entity->open = XML_TRUE; entityTrackingOnOpen(parser, entity, __LINE__); if (! parser->m_externalEntityRefHandler( diff --git a/parser/expat/13_no_debug_report.patch b/parser/expat/13_no_debug_report.patch index 61269d4bbf..405f2489af 100644 --- a/parser/expat/13_no_debug_report.patch +++ b/parser/expat/13_no_debug_report.patch @@ -26,7 +26,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c #endif /* XML_GE == 1 */ typedef enum XML_Error PTRCALL Processor(XML_Parser parser, const char *start, -@@ -632,18 +636,22 @@ +@@ -630,18 +634,22 @@ static float accountingGetCurrentAmplification(XML_Parser rootParser); static void accountingReportStats(XML_Parser originParser, const char *epilog); static void accountingOnAbort(XML_Parser originParser); @@ -49,7 +49,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void entityTrackingOnOpen(XML_Parser parser, ENTITY *entity, int sourceLine); static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity, -@@ -653,8 +661,10 @@ +@@ -651,8 +659,10 @@ static XML_Parser getRootParserOf(XML_Parser parser, unsigned int *outLevelDiff); @@ -60,7 +60,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c #define poolStart(pool) ((pool)->start) #define poolLength(pool) ((pool)->ptr - (pool)->start) -@@ -795,8 +805,10 @@ +@@ -793,8 +803,10 @@ #if XML_GE == 1 ACCOUNTING m_accounting; MALLOC_TRACKER m_alloc_tracker; @@ -72,7 +72,20 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c #ifdef MOZILLA_CLIENT /* Report opening tag of mismatched closing tag */ const XML_Char* m_mismatch; #endif -@@ -1638,15 +1650,19 @@ +@@ -1209,10 +1221,12 @@ + + static unsigned long + ENTROPY_DEBUG(const char *label, unsigned long entropy) { ++#ifndef MOZILLA_CLIENT /* don't report debug information */ + if (getDebugLevel("EXPAT_ENTROPY_DEBUG", 0) >= 1u) { + fprintf(stderr, "expat: Entropy: %s --> 0x%0*lx (%lu bytes)\n", label, + (int)sizeof(entropy) * 2, entropy, (unsigned long)sizeof(entropy)); + } ++#endif + return entropy; + } + +@@ -1632,15 +1646,19 @@ #if XML_GE == 1 memset(&parser->m_accounting, 0, sizeof(ACCOUNTING)); @@ -93,7 +106,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c } /* moves list of bindings to m_freeBindingList */ -@@ -8668,6 +8684,7 @@ +@@ -8662,6 +8680,7 @@ static void accountingReportStats(XML_Parser originParser, const char *epilog) { @@ -101,7 +114,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c const XML_Parser rootParser = getRootParserOf(originParser, NULL); assert(! rootParser->m_parentParser); -@@ -8683,6 +8700,7 @@ +@@ -8677,6 +8696,7 @@ (void *)rootParser, rootParser->m_accounting.countBytesDirect, rootParser->m_accounting.countBytesIndirect, (double)amplificationFactor, epilog); @@ -109,7 +122,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c } static void -@@ -8690,6 +8708,7 @@ +@@ -8684,6 +8704,7 @@ accountingReportStats(originParser, " ABORTING\n"); } @@ -117,7 +130,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void accountingReportDiff(XML_Parser rootParser, unsigned int levelsAwayFromRootParser, const char *before, -@@ -8726,6 +8745,7 @@ +@@ -8720,6 +8741,7 @@ } fprintf(stderr, "\"\n"); } @@ -125,7 +138,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static XML_Bool accountingDiffTolerated(XML_Parser originParser, int tok, const char *before, -@@ -8773,11 +8793,13 @@ +@@ -8767,11 +8789,13 @@ || (amplificationFactor <= rootParser->m_accounting.maximumAmplificationFactor); @@ -139,7 +152,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c return tolerated; } -@@ -8796,6 +8818,7 @@ +@@ -8790,6 +8814,7 @@ return parser->m_accounting.countBytesIndirect; } @@ -147,7 +160,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity, const char *action, int sourceLine) { -@@ -8819,9 +8842,11 @@ +@@ -8813,9 +8838,11 @@ entity->is_param ? "%" : "&", entityName, action, entity->textLen, sourceLine); } @@ -159,7 +172,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c const XML_Parser rootParser = getRootParserOf(originParser, NULL); assert(! rootParser->m_parentParser); -@@ -8833,15 +8858,18 @@ +@@ -8827,15 +8854,18 @@ } entityTrackingReportStats(rootParser, entity, "OPEN ", sourceLine); @@ -178,7 +191,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c } #endif /* XML_GE == 1 */ -@@ -8863,6 +8891,7 @@ +@@ -8857,6 +8887,7 @@ #if XML_GE == 1 @@ -186,7 +199,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c const char * unsignedCharToPrintable(unsigned char c) { switch (c) { -@@ -9386,9 +9415,11 @@ +@@ -9380,9 +9411,11 @@ assert(0); /* never gets here */ // LCOV_EXCL_STOP } @@ -198,7 +211,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static unsigned long getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) { const char *const valueOrNull = getenv(variableName); -@@ -9407,3 +9438,4 @@ +@@ -9401,3 +9434,4 @@ return debugLevel; } diff --git a/parser/expat/14_unused.patch b/parser/expat/14_unused.patch index 0895c12d33..ef2ad18bb1 100644 --- a/parser/expat/14_unused.patch +++ b/parser/expat/14_unused.patch @@ -22,7 +22,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void FASTCALL hashTableDestroy(HASH_TABLE *table); static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table); -@@ -1042,6 +1046,7 @@ +@@ -1040,6 +1044,7 @@ } #endif // XML_GE == 1 @@ -30,7 +30,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c XML_Parser XMLCALL XML_ParserCreate(const XML_Char *encodingName) { return XML_ParserCreate_MM(encodingName, NULL, NULL); -@@ -1052,6 +1057,7 @@ +@@ -1050,6 +1055,7 @@ XML_Char tmp[2] = {nsSep, 0}; return XML_ParserCreate_MM(encodingName, NULL, tmp); } @@ -38,7 +38,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c // "xml=http://www.w3.org/XML/1998/namespace" static const XML_Char implicitContext[] -@@ -1665,6 +1671,7 @@ +@@ -1661,6 +1667,7 @@ #endif /* XML_GE == 1 */ } @@ -46,7 +46,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c /* moves list of bindings to m_freeBindingList */ static void FASTCALL moveToFreeBindingList(XML_Parser parser, BINDING *bindings) { -@@ -1773,6 +1780,7 @@ +@@ -1769,6 +1776,7 @@ } return XML_STATUS_OK; } @@ -54,7 +54,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c XML_Parser XMLCALL XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context, -@@ -2059,6 +2067,7 @@ +@@ -2055,6 +2063,7 @@ parser->m_handlerArg = parser; } @@ -62,7 +62,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c enum XML_Error XMLCALL XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) { if (parser == NULL) -@@ -2072,8 +2081,9 @@ +@@ -2068,8 +2077,9 @@ #else UNUSED_P(useDTD); return XML_ERROR_FEATURE_REQUIRES_XML_DTD; @@ -73,7 +73,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetReturnNSTriplet(XML_Parser parser, int do_nst) { -@@ -2148,6 +2158,7 @@ +@@ -2144,6 +2154,7 @@ parser->m_endElementHandler = end; } @@ -81,7 +81,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler start) { if (parser != NULL) -@@ -2159,6 +2170,7 @@ +@@ -2155,6 +2166,7 @@ if (parser != NULL) parser->m_endElementHandler = end; } @@ -89,7 +89,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetCharacterDataHandler(XML_Parser parser, -@@ -2190,6 +2202,7 @@ +@@ -2186,6 +2198,7 @@ parser->m_endCdataSectionHandler = end; } @@ -97,7 +97,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetStartCdataSectionHandler(XML_Parser parser, XML_StartCdataSectionHandler start) { -@@ -2211,6 +2224,7 @@ +@@ -2207,6 +2220,7 @@ parser->m_defaultHandler = handler; parser->m_defaultExpandInternalEntities = XML_FALSE; } @@ -105,7 +105,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler) { -@@ -2229,6 +2243,7 @@ +@@ -2225,6 +2239,7 @@ parser->m_endDoctypeDeclHandler = end; } @@ -113,7 +113,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetStartDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start) { -@@ -2241,6 +2256,7 @@ +@@ -2237,6 +2252,7 @@ if (parser != NULL) parser->m_endDoctypeDeclHandler = end; } @@ -121,7 +121,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetUnparsedEntityDeclHandler(XML_Parser parser, -@@ -2265,6 +2281,7 @@ +@@ -2261,6 +2277,7 @@ parser->m_endNamespaceDeclHandler = end; } @@ -129,7 +129,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetStartNamespaceDeclHandler(XML_Parser parser, XML_StartNamespaceDeclHandler start) { -@@ -2285,6 +2302,7 @@ +@@ -2281,6 +2298,7 @@ if (parser != NULL) parser->m_notStandaloneHandler = handler; } @@ -137,7 +137,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetExternalEntityRefHandler(XML_Parser parser, -@@ -2303,6 +2321,7 @@ +@@ -2299,6 +2317,7 @@ parser->m_externalEntityRefHandlerArg = parser; } @@ -145,7 +145,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetSkippedEntityHandler(XML_Parser parser, XML_SkippedEntityHandler handler) { -@@ -2336,6 +2355,7 @@ +@@ -2332,6 +2351,7 @@ if (parser != NULL) parser->m_entityDeclHandler = handler; } @@ -153,7 +153,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler handler) { -@@ -2804,6 +2824,7 @@ +@@ -2800,6 +2820,7 @@ #endif } @@ -161,7 +161,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c int XMLCALL XML_GetCurrentByteCount(XML_Parser parser) { if (parser == NULL) -@@ -2832,6 +2853,7 @@ +@@ -2828,6 +2849,7 @@ #endif /* XML_CONTEXT_BYTES > 0 */ return (const char *)0; } @@ -169,7 +169,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c XML_Size XMLCALL XML_GetCurrentLineNumber(XML_Parser parser) { -@@ -2857,6 +2879,7 @@ +@@ -2853,6 +2875,7 @@ return parser->m_position.columnNumber; } @@ -177,7 +177,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c void XMLCALL XML_FreeContentModel(XML_Parser parser, XML_Content *model) { if (parser == NULL) -@@ -3102,11 +3125,12 @@ +@@ -3098,11 +3121,12 @@ {XML_FEATURE_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT, XML_L("XML_AT_ACT_THRES"), (long int)EXPAT_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT}, @@ -191,7 +191,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c #if XML_GE == 1 XML_Bool XMLCALL -@@ -7727,6 +7751,7 @@ +@@ -7723,6 +7747,7 @@ return p; } @@ -199,7 +199,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void dtdReset(DTD *p, XML_Parser parser) { HASH_TABLE_ITER iter; -@@ -7767,6 +7792,7 @@ +@@ -7763,6 +7788,7 @@ p->hasParamEntityRefs = XML_FALSE; p->standalone = XML_FALSE; } @@ -207,7 +207,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void dtdDestroy(DTD *p, XML_Bool isDocEntity, XML_Parser parser) { -@@ -8121,6 +8147,7 @@ +@@ -8117,6 +8143,7 @@ return table->v[i]; } @@ -215,7 +215,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void FASTCALL hashTableClear(HASH_TABLE *table) { size_t i; -@@ -8130,6 +8157,7 @@ +@@ -8126,6 +8153,7 @@ } table->used = 0; } @@ -223,7 +223,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c static void FASTCALL hashTableDestroy(HASH_TABLE *table) { -@@ -8804,6 +8832,7 @@ +@@ -8800,6 +8828,7 @@ return tolerated; } @@ -231,7 +231,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c unsigned long long testingAccountingGetCountBytesDirect(XML_Parser parser) { if (! parser) -@@ -8817,6 +8846,7 @@ +@@ -8813,6 +8842,7 @@ return 0; return parser->m_accounting.countBytesIndirect; } diff --git a/parser/expat/15_mcp_2_7_3.patch b/parser/expat/15_mcp_2_7_3.patch index fdcf6cf700..b1f576a6da 100644 --- a/parser/expat/15_mcp_2_7_3.patch +++ b/parser/expat/15_mcp_2_7_3.patch @@ -1,7 +1,7 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c --- a/lib/xmlparse.c +++ b/lib/xmlparse.c -@@ -1443,8 +1443,10 @@ +@@ -1439,8 +1439,10 @@ // Initialize .m_alloc_tracker memset(&parser->m_alloc_tracker, 0, sizeof(MALLOC_TRACKER)); if (parentParser == NULL) { @@ -12,18 +12,18 @@ diff --git a/lib/xmlparse.c b/lib/xmlparse.c parser->m_alloc_tracker.maximumAmplificationFactor = EXPAT_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION_DEFAULT; parser->m_alloc_tracker.activationThresholdBytes -@@ -1741,6 +1743,7 @@ +@@ -1737,6 +1739,7 @@ dtdReset(parser->m_dtd, parser); return XML_TRUE; } +#endif /* MOZILLA_CLIENT */ - + static XML_Bool parserBusy(XML_Parser parser) { -@@ -1755,6 +1758,7 @@ +@@ -1751,6 +1754,7 @@ } } - + +#ifndef MOZILLA_CLIENT /* unused API */ enum XML_Status XMLCALL XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) {