aboutsummaryrefslogtreecommitdiff
path: root/engines/lilliput
diff options
context:
space:
mode:
authorStrangerke2018-04-20 06:54:11 +0200
committerStrangerke2018-04-20 06:55:10 +0200
commitc0de8dd04d2704eefb4b5d11838c810f31d21bfe (patch)
tree7e5168b3c0c0d2db147534756d69e96733ef1c4d /engines/lilliput
parent94793803106ff2a7e6366b35f223f11715045546 (diff)
downloadscummvm-rg350-c0de8dd04d2704eefb4b5d11838c810f31d21bfe.tar.gz
scummvm-rg350-c0de8dd04d2704eefb4b5d11838c810f31d21bfe.tar.bz2
scummvm-rg350-c0de8dd04d2704eefb4b5d11838c810f31d21bfe.zip
LILLIPUT: Fix unsafe read of string reported by coverity
Diffstat (limited to 'engines/lilliput')
-rw-r--r--engines/lilliput/detection.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/engines/lilliput/detection.cpp b/engines/lilliput/detection.cpp
index 466c89e362..eb65ad2d64 100644
--- a/engines/lilliput/detection.cpp
+++ b/engines/lilliput/detection.cpp
@@ -227,9 +227,11 @@ SaveStateDescriptor LilliputMetaEngine::querySaveMetaInfos(const char *target, i
}
uint32 saveNameLength = file->readUint16BE();
- char saveName[256];
- file->read(saveName, saveNameLength);
- saveName[saveNameLength] = 0;
+ Common::String saveName;
+ for (uint32 i = 0; i < saveNameLength; ++i) {
+ char curChr = file->readByte();
+ saveName += curChr;
+ }
SaveStateDescriptor desc(slot, saveName);