diff options
author | Strangerke | 2018-04-20 06:54:11 +0200 |
---|---|---|
committer | Strangerke | 2018-04-20 06:55:10 +0200 |
commit | c0de8dd04d2704eefb4b5d11838c810f31d21bfe (patch) | |
tree | 7e5168b3c0c0d2db147534756d69e96733ef1c4d /engines | |
parent | 94793803106ff2a7e6366b35f223f11715045546 (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/lilliput/detection.cpp | 8 |
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); |