aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorD G Turner2014-05-17 12:16:19 +0100
committerD G Turner2014-05-17 12:16:19 +0100
commit16152cf1ea7807546cc40c8ba094ce874e2f877a (patch)
tree4aea2a6a7d7b68981b77528d3f67e4156edd196e /engines
parent71aab5ab1df735bdcd776b05a5a180a3482a1345 (diff)
downloadscummvm-rg350-16152cf1ea7807546cc40c8ba094ce874e2f877a.tar.gz
scummvm-rg350-16152cf1ea7807546cc40c8ba094ce874e2f877a.tar.bz2
scummvm-rg350-16152cf1ea7807546cc40c8ba094ce874e2f877a.zip
HOPKINS: Add sanity check to parsing of COMPUTAN.TXT file.
This previously crashed on the Polish version due to a variant file format causing the parsing to make several invalid memory accesses. This prevents this crash and any other in future, though it does not fix the parsing of the variant file format.
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/computer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/hopkins/computer.cpp b/engines/hopkins/computer.cpp
index 1307cd5796..4f8e373899 100644
--- a/engines/hopkins/computer.cpp
+++ b/engines/hopkins/computer.cpp
@@ -392,7 +392,7 @@ void ComputerManager::loadMenu() {
++lineNum;
}
++tmpPtr;
- } while (!loopCond);
+ } while (!loopCond && tmpPtr[0] != '\0' && lineNum < 50);
_vm->_globals->freeMemory((byte *)ptr);
}