diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c index 35b5597e..db15eae1 100644 --- a/expat/lib/xmlparse.c +++ b/expat/lib/xmlparse.c @@ -4022,7 +4022,8 @@ epilogProcessor(XML_Parser parser, int tok = XmlPrologTok(encoding, s, end, &next); eventEndPtr = next; switch (tok) { - case -XML_TOK_PROLOG_S: + /* report partial linebreak - it might be the last token */ + case -XML_TOK_PROLOG_S: if (defaultHandler) { eventEndPtr = next; reportDefault(parser, encoding, s, next); diff --git a/expat/lib/xmltok_impl.c b/expat/lib/xmltok_impl.c index 30d32903..f4a34387 100644 --- a/expat/lib/xmltok_impl.c +++ b/expat/lib/xmltok_impl.c @@ -1011,6 +1011,7 @@ PREFIX(prologTok)(const ENCODING *enc, const char *ptr, const char *end, case BT_CR: if (ptr + MINBPC(enc) == end) { *nextTokPtr = end; + /* indicate that this might be part of a CR/LF pair */ return -XML_TOK_PROLOG_S; } /* fall through */