[Scummvm-git-logs] scummvm master -> 7af31d6614766c2e53c5b1e6240309e2f9382abe

Strangerke Strangerke at scummvm.org
Fri Apr 20 07:29:14 CEST 2018


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c0de8dd04d LILLIPUT: Fix unsafe read of string reported by coverity
2f00d52a23 LILLIPUT: Fix memory leak
7af31d6614 LILLIPUT: Add safeguard in homeInPathFinding


Commit: c0de8dd04d2704eefb4b5d11838c810f31d21bfe
    https://github.com/scummvm/scummvm/commit/c0de8dd04d2704eefb4b5d11838c810f31d21bfe
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-04-20T06:55:10+02:00

Commit Message:
LILLIPUT: Fix unsafe read of string reported by coverity

Changed paths:
    engines/lilliput/detection.cpp


diff --git a/engines/lilliput/detection.cpp b/engines/lilliput/detection.cpp
index 466c89e..eb65ad2 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);
 


Commit: 2f00d52a2344552242afb69d27ff4a459559a0fc
    https://github.com/scummvm/scummvm/commit/2f00d52a2344552242afb69d27ff4a459559a0fc
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-04-20T07:10:38+02:00

Commit Message:
LILLIPUT: Fix memory leak

Changed paths:
    engines/lilliput/lilliput.cpp


diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 4624209..800d5b3 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -256,6 +256,8 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
 LilliputEngine::~LilliputEngine() {
 	DebugMan.clearAllDebugChannels();
 	delete _console;
+	delete _soundHandler;
+	delete _scriptHandler;
 	delete _rnd;
 }
 


Commit: 7af31d6614766c2e53c5b1e6240309e2f9382abe
    https://github.com/scummvm/scummvm/commit/7af31d6614766c2e53c5b1e6240309e2f9382abe
Author: Strangerke (strangerke at scummvm.org)
Date: 2018-04-20T07:21:06+02:00

Commit Message:
LILLIPUT: Add safeguard in homeInPathFinding

Changed paths:
    engines/lilliput/lilliput.cpp


diff --git a/engines/lilliput/lilliput.cpp b/engines/lilliput/lilliput.cpp
index 800d5b3..97767a6 100644
--- a/engines/lilliput/lilliput.cpp
+++ b/engines/lilliput/lilliput.cpp
@@ -1389,7 +1389,10 @@ void LilliputEngine::homeInPathFinding(int index) {
 
 	if (enclosureSrc == -1) {
 		int tmpVal = checkOuterEnclosure(_characterTargetPos[index]);
-		_characterSubTargetPos[index] = _portalPos[tmpVal];
+		if (tmpVal == -1)
+			warning("homeInPathFinding: Unexpected negative index");
+		else
+			_characterSubTargetPos[index] = _portalPos[tmpVal];
 		return;
 	}
 





More information about the Scummvm-git-logs mailing list