diff --git a/Misc/NEWS b/Misc/NEWS index 03cd7dff327..f5275b8cc4d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -610,6 +610,9 @@ Extension Modules - Issue #2389: Array objects are now pickled in a portable manner. +- 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 e04426d0cc1..105958b6496 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 */