diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-08 04:06:42 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-12-08 04:06:42 +0000 |
commit | 580c870e3fabbdd52bad109098ef569992c1d69c (patch) | |
tree | 517ae94e1fc5f487fd2c8f3986eb6e7bc2fc5cd0 | |
parent | beaf92f7207ed6d94bf2df504e137d284502b747 (diff) | |
parent | ac7aa55a5cd612e3bdcbd54a0a2866f6ee1a4881 (diff) | |
download | expat-580c870e3fabbdd52bad109098ef569992c1d69c.tar.gz |
Merge cherrypicks of ['ag/20497951'] into security-aosp-sc-release.android-security-12.0.0_r60android-security-12.0.0_r59android-security-12.0.0_r58android-security-12.0.0_r57android-security-12.0.0_r56android-security-12.0.0_r55android-security-12.0.0_r54android-security-12.0.0_r53android-security-12.0.0_r52android-security-12.0.0_r51android-security-12.0.0_r50android-security-12.0.0_r49android-security-12.0.0_r48android-security-12.0.0_r47android-security-12.0.0_r46android-security-12.0.0_r45android-security-12.0.0_r44android12-security-release
Change-Id: I44def1370de2b6e68242cd67c76f77b7b57ad7a7
-rw-r--r-- | lib/xmlparse.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/xmlparse.c b/lib/xmlparse.c index 729f94b8..381f3ef3 100644 --- a/lib/xmlparse.c +++ b/lib/xmlparse.c @@ -978,6 +978,14 @@ parserCreate(const XML_Char *encodingName, parserInit(parser, encodingName); if (encodingName && ! parser->m_protocolEncodingName) { + if (dtd) { + // We need to stop the upcoming call to XML_ParserFree from happily + // destroying parser->m_dtd because the DTD is shared with the parent + // parser and the only guard that keeps XML_ParserFree from destroying + // parser->m_dtd is parser->m_isParamEntity but it will be set to + // XML_TRUE only later in XML_ExternalEntityParserCreate (or not at all). + parser->m_dtd = NULL; + } XML_ParserFree(parser); return NULL; } |