From 2b88bb3b763af88e7f2b141fda749de76034b65a 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 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c8b4d271f9b7be65db75d2228c590b95583bfc7a Author: [CST] Focus Date: 2012-05-14 (Mon, 14 May 2012) --- 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;