From c8b4d271f9b7be65db75d2228c590b95583bfc7a Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Mon, 14 May 2012 18:30:55 +0400 Subject: [PATCH] lib/xmltree/xmlparse.cpp: fix (workaround?) for crash while parsing invalid saved xml --- lib/xmltree/xmlparse.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/xmltree/xmlparse.cpp b/lib/xmltree/xmlparse.cpp index 95643c609..d0a531824 100644 --- a/lib/xmltree/xmlparse.cpp +++ b/lib/xmltree/xmlparse.cpp @@ -392,7 +392,8 @@ long XML_Parser::GetCurrentByteIndex() int XML_Parser::GetCurrentLineNumber() { - if (eventPtr) + /* at EOF positionPtr point to input, while eventPtr not updated -- focus */ + if (eventPtr && (positionPtr < eventPtr)) { XmlUpdatePosition(encoding, positionPtr, eventPtr, &position); positionPtr=eventPtr;