Skip to content

Commit

Permalink
Update Expat XML parser to v2.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
beutlich committed Mar 13, 2024
1 parent a3bd1b3 commit 364aba5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ExternData/Resources/C-Sources/expat/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Expat, Release 2.6.1
# Expat, Release 2.6.2

This is Expat, a C99 library for parsing
[XML 1.0 Fourth Edition](https://www.w3.org/TR/2006/REC-xml-20060816/), started by
Expand Down
2 changes: 1 addition & 1 deletion ExternData/Resources/C-Sources/expat/lib/expat.h
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
*/
#define XML_MAJOR_VERSION 2
#define XML_MINOR_VERSION 6
#define XML_MICRO_VERSION 1
#define XML_MICRO_VERSION 2

#ifdef __cplusplus
}
Expand Down
10 changes: 7 additions & 3 deletions ExternData/Resources/C-Sources/expat/lib/xmlparse.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* dd2a9703e301882afe16d198a82689ab225277057f5eab9d079d8606eab736b4 (2.6.1+)
/* 2a14271ad4d35e82bde8ba210b4edb7998794bcbae54deab114046a300f9639a (2.6.2+)
__ __ _
___\ \/ /_ __ __ _| |_
/ _ \\ /| '_ \ / _` | __|
Expand Down Expand Up @@ -6262,7 +6262,7 @@ storeEntityValue(XML_Parser parser, const ENCODING *enc,
dtd->keepProcessing = dtd->standalone;
goto endEntityValue;
}
if (entity->open) {
if (entity->open || (entity == parser->m_declEntity)) {
if (enc == parser->m_encoding)
parser->m_eventPtr = entityTextPtr;
result = XML_ERROR_RECURSIVE_ENTITY_REF;
Expand Down Expand Up @@ -7817,14 +7817,18 @@ copyString(const XML_Char *s, const XML_Memory_Handling_Suite *memsuite) {

static float
accountingGetCurrentAmplification(XML_Parser rootParser) {
// 1.........1.........12 => 22
const size_t lenOfShortestInclude = sizeof("<!ENTITY a SYSTEM 'b'>") - 1;
const XmlBigCount countBytesOutput
= rootParser->m_accounting.countBytesDirect
+ rootParser->m_accounting.countBytesIndirect;
const float amplificationFactor
= rootParser->m_accounting.countBytesDirect
? (countBytesOutput
/ (float)(rootParser->m_accounting.countBytesDirect))
: 1.0f;
: ((lenOfShortestInclude
+ rootParser->m_accounting.countBytesIndirect)
/ (float)lenOfShortestInclude);
assert(! rootParser->m_parentParser);
return amplificationFactor;
}
Expand Down

0 comments on commit 364aba5

Please sign in to comment.