summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/binaryformat.cpp
diff options
context:
space:
mode:
authorkh1 <karsten.heimrich@digia.com>2013-09-24 14:14:14 +0200
committerKarsten Heimrich <karsten.heimrich@digia.com>2013-09-24 16:39:33 +0200
commitfc465784df7893abc180ede9b69b4e27aaa522f7 (patch)
treefb452b527a8cacda862ad66b366bfa79dc12e24a /src/libs/installer/binaryformat.cpp
parent74f1ba9329f70b9f4b716fa882774de883fbee75 (diff)
We can't expect a multiple of 8 during marker search.
Once the marker was on a position not matching a multiple of 8 from the end, the search would fail. Now decrement by 1 byte. Change-Id: Ia703c9074b3bef6b1a300865abfe24dcb2c8d5fd Reviewed-by: Tim Jenssen <tim.jenssen@digia.com> Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'src/libs/installer/binaryformat.cpp')
-rw-r--r--src/libs/installer/binaryformat.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/installer/binaryformat.cpp b/src/libs/installer/binaryformat.cpp
index 8e79e84c3..fe1c61ced 100644
--- a/src/libs/installer/binaryformat.cpp
+++ b/src/libs/installer/binaryformat.cpp
@@ -237,7 +237,7 @@ qint64 QInstaller::findMagicCookie(QFile *in, quint64 magicCookie)
while (searched >= 0) {
if (memcmp(&magicCookie, (mapped + searched), markerSize) == 0)
return (fileSize - maxSearch) + searched;
- searched -= markerSize;
+ --searched;
}
throw Error(QObject::tr("No marker found, stopped after %1.").arg(humanReadableSize(maxSearch)));