From 5fd1f8e484a27595257628a48c3d9dbbe1843ab3 Mon Sep 17 00:00:00 2001 From: Jakub Stachowski Date: Sat, 17 Jan 2009 15:11:13 +0000 Subject: [PATCH] Protect against links pointing to after end of the document svn path=/trunk/playground/graphics/okular/mobipocket/; revision=912501 --- mobidocument.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mobidocument.cpp b/mobidocument.cpp index d4e9071f2..354f50c09 100644 --- a/mobidocument.cpp +++ b/mobidocument.cpp @@ -76,6 +76,8 @@ QString MobiDocument::fixMobiMarkup(const QString& data) QMapIterator it(anchorPositions); while (it.hasNext()) { it.next(); + // link pointing outside the document + if ( (it.key()+offset) >= ret.size()) continue; int fixedpos=outsideTag(ret, it.key()+offset); ret.insert(fixedpos,QString("")); offset+=12+it.value().size();