[Scummvm-cvs-logs] scummvm master -> ce7ab0fcfea1453f2d43d6f17baeec94675509ed
sev-
sev at scummvm.org
Wed May 11 12:44:13 CEST 2016
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:
775b615fdd CRUISE: Safer string manipulation
a57aa55999 TINSEL: Safer string manipulation
ce7ab0fcfe SCUMM HE: Fix compilation when HE games are disabled
Commit: 775b615fdd786f67b3a784a8364f06afd7d71e97
https://github.com/scummvm/scummvm/commit/775b615fdd786f67b3a784a8364f06afd7d71e97
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-11T12:30:50+02:00
Commit Message:
CRUISE: Safer string manipulation
Changed paths:
engines/cruise/ctp.cpp
diff --git a/engines/cruise/ctp.cpp b/engines/cruise/ctp.cpp
index 9515b55..4458e39 100644
--- a/engines/cruise/ctp.cpp
+++ b/engines/cruise/ctp.cpp
@@ -307,7 +307,7 @@ int initCt(const char *ctpName) {
MemFree(ptr);
if (ctpName != currentCtpName)
- strcpy(currentCtpName, ctpName);
+ Common::strlcpy(currentCtpName, ctpName, 40);
numberOfWalkboxes = segementSizeTable[6] / 2; // get the number of walkboxes
Commit: a57aa559991dc47b0d3633b0a59ffff35358b236
https://github.com/scummvm/scummvm/commit/a57aa559991dc47b0d3633b0a59ffff35358b236
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-11T12:32:18+02:00
Commit Message:
TINSEL: Safer string manipulation
Changed paths:
engines/tinsel/bmv.cpp
engines/tinsel/detection.cpp
engines/tinsel/dialogs.cpp
engines/tinsel/handle.cpp
engines/tinsel/saveload.cpp
diff --git a/engines/tinsel/bmv.cpp b/engines/tinsel/bmv.cpp
index 22c3798..cfe97e6 100644
--- a/engines/tinsel/bmv.cpp
+++ b/engines/tinsel/bmv.cpp
@@ -567,8 +567,8 @@ void BMVPlayer::PlayBMV(CORO_PARAM, SCNHANDLE hFileStem, int myEscape) {
assert(!bMovieOn);
- strcpy(szMovieFile, (char *)LockMem(hFileStem));
- strcat(szMovieFile, BMOVIE_EXTENSION);
+ Common::strlcpy(szMovieFile, (char *)LockMem(hFileStem), 14);
+ Common::strlcat(szMovieFile, BMOVIE_EXTENSION, 14);
assert(strlen(szMovieFile) <= 12);
diff --git a/engines/tinsel/detection.cpp b/engines/tinsel/detection.cpp
index 2fde6e7..c44f1f4 100644
--- a/engines/tinsel/detection.cpp
+++ b/engines/tinsel/detection.cpp
@@ -235,7 +235,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFile
for (fileDesc = g->desc.filesDescriptions; fileDesc->fileName; fileDesc++) {
// Get the next filename, stripping off any '1' suffix character
char tempFilename[50];
- strcpy(tempFilename, fileDesc->fileName);
+ Common::strlcpy(tempFilename, fileDesc->fileName, 50);
char *pOne = strchr(tempFilename, '1');
if (pOne) {
do {
@@ -275,7 +275,7 @@ const ADGameDescription *TinselMetaEngine::fallbackDetect(const FileMap &allFile
for (fileDesc = g->desc.filesDescriptions; fileDesc->fileName; fileDesc++) {
// Get the next filename, stripping off any '1' suffix character
char tempFilename[50];
- strcpy(tempFilename, fileDesc->fileName);
+ Common::strlcpy(tempFilename, fileDesc->fileName, 50);
char *pOne = strchr(tempFilename, '1');
if (pOne) {
do {
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 4bc28ff..ad20253 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -1671,10 +1671,10 @@ static void Select(int i, bool force) {
#else
// Current description with cursor appended
if (cd.box[i].boxText != NULL) {
- strcpy(g_sedit, cd.box[i].boxText);
- strcat(g_sedit, sCursor);
+ Common::strlcpy(g_sedit, cd.box[i].boxText, SG_DESC_LEN+2);
+ Common::strlcat(g_sedit, sCursor, SG_DESC_LEN+2);
} else {
- strcpy(g_sedit, sCursor);
+ Common::strlcpy(g_sedit, sCursor, SG_DESC_LEN+2);
}
#endif
diff --git a/engines/tinsel/handle.cpp b/engines/tinsel/handle.cpp
index 62d244e..9ffd477 100644
--- a/engines/tinsel/handle.cpp
+++ b/engines/tinsel/handle.cpp
@@ -258,7 +258,7 @@ void LoadExtraGraphData(SCNHANDLE start, SCNHANDLE next) {
}
void SetCdPlaySceneDetails(int fileNum, const char *fileName) {
- strcpy(g_szCdPlayFile, fileName);
+ Common::strlcpy(g_szCdPlayFile, fileName, 100);
}
void SetCdPlayHandle(int fileNum) {
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 88cd80b..226cbb5 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -563,7 +563,7 @@ static void DoSave() {
while (1) {
Common::String fname = _vm->getSavegameFilename(ano);
- strcpy(tmpName, fname.c_str());
+ Common::strlcpy(tmpName, fname.c_str(), FNAMELEN);
for (i = 0; i < g_numSfiles; i++)
if (!strcmp(g_savedFiles[i].name, tmpName))
Commit: ce7ab0fcfea1453f2d43d6f17baeec94675509ed
https://github.com/scummvm/scummvm/commit/ce7ab0fcfea1453f2d43d6f17baeec94675509ed
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-11T12:44:22+02:00
Commit Message:
SCUMM HE: Fix compilation when HE games are disabled
Changed paths:
engines/scumm/he/moonbase/moonbase.h
diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h
index b3223b6..003467e 100644
--- a/engines/scumm/he/moonbase/moonbase.h
+++ b/engines/scumm/he/moonbase/moonbase.h
@@ -92,8 +92,8 @@ private:
Common::String _fileName;
};
-#endif
-
} // End of namespace Scumm
-#endif
+#endif // ENABLE_HE
+
+#endif // SCUMM_HE_MOONBASE_H
More information about the Scummvm-git-logs
mailing list