aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2007-06-06 13:29:27 +0000
committerEugene Sandulenko2007-06-06 13:29:27 +0000
commit603ef8689426b61bf51af74ddc9258f8628ec30b (patch)
treebfe422307ffc83118a885316cc9a34cdb2f07f0c /engines
parent99d2736c9d8f6929b1c52d21263df3f185f96e46 (diff)
downloadscummvm-rg350-603ef8689426b61bf51af74ddc9258f8628ec30b.tar.gz
scummvm-rg350-603ef8689426b61bf51af74ddc9258f8628ec30b.tar.bz2
scummvm-rg350-603ef8689426b61bf51af74ddc9258f8628ec30b.zip
Fix potential memory overwrite here too.
svn-id: r27134
Diffstat (limited to 'engines')
-rw-r--r--engines/agi/agi_v3.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/agi/agi_v3.cpp b/engines/agi/agi_v3.cpp
index 3e90dc11f1..142a6071ca 100644
--- a/engines/agi/agi_v3.cpp
+++ b/engines/agi/agi_v3.cpp
@@ -64,7 +64,7 @@ int AgiLoader_v3::detectGame() {
if (f.hasSuffix("vol.0")) {
memset(_vm->_game.name, 0, 8);
- strncpy(_vm->_game.name, f.c_str(), f.size() > 5 ? f.size() - 5 : f.size());
+ strncpy(_vm->_game.name, f.c_str(), MAX((uint)8, f.size() > 5 ? f.size() - 5 : f.size()));
debugC(3, kDebugLevelMain, "game.name = %s", _vm->_game.name);
_intVersion = 0x3149; // setup for 3.002.149
ec = _vm->v3IdGame();