From: Matthias Klose Date: Fri, 22 Jan 2010 00:39:04 +0000 (+0000) Subject: - Expat: Fix DoS via XML document with malformed UTF-8 sequences X-Git-Tag: v2.7a3~108 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d948ac90cc92aa7724a20b47226bf2e512e30ab;p=python - Expat: Fix DoS via XML document with malformed UTF-8 sequences (CVE_2009_3560). --- diff --git a/Misc/NEWS b/Misc/NEWS index 7501e874ae..fa5df7dcfb 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -66,6 +66,12 @@ Library Extension extra options may change the output without changing the .c file). Initial patch by Collin Winter. +Extension Modules +----------------- + +- Expat: Fix DoS via XML document with malformed UTF-8 sequences + (CVE_2009_3560). + Build ----- diff --git a/Modules/expat/xmlparse.c b/Modules/expat/xmlparse.c index e04426d0cc..105958b649 100644 --- a/Modules/expat/xmlparse.c +++ b/Modules/expat/xmlparse.c @@ -3682,6 +3682,9 @@ doProlog(XML_Parser parser, return XML_ERROR_UNCLOSED_TOKEN; case XML_TOK_PARTIAL_CHAR: return XML_ERROR_PARTIAL_CHAR; + case -XML_TOK_PROLOG_S: + tok = -tok; + break; case XML_TOK_NONE: #ifdef XML_DTD /* for internal PE NOT referenced between declarations */