diff options
author | Eugene Sandulenko | 2007-06-06 13:25:48 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2007-06-06 13:25:48 +0000 |
commit | 99d2736c9d8f6929b1c52d21263df3f185f96e46 (patch) | |
tree | 109798abde6fc7aec43c1ca91f8adaf7e196ad06 | |
parent | 5e62538708cea1bfc2acd35b550117aa6c017f8a (diff) | |
download | scummvm-rg350-99d2736c9d8f6929b1c52d21263df3f185f96e46.tar.gz scummvm-rg350-99d2736c9d8f6929b1c52d21263df3f185f96e46.tar.bz2 scummvm-rg350-99d2736c9d8f6929b1c52d21263df3f185f96e46.zip |
Fix potential memory overwrite
svn-id: r27132
-rw-r--r-- | engines/agi/detection.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 9f6f0e7156..7b8a464ac6 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -1907,7 +1907,7 @@ Common::ADGameDescList fallbackDetector(const FSList *fslist) { for (IntMap::const_iterator f = allFiles.begin(); f != allFiles.end(); ++f) { if (f->_key.hasSuffix("vol.0")) { memset(name, 0, 8); - strncpy(name, f->_key.c_str(), f->_key.size() > 5 ? f->_key.size() - 5 : f->_key.size()); + strncpy(name, f->_key.c_str(), MAX((uint)8, f->_key.size() > 5 ? f->_key.size() - 5 : f->_key.size())); if (allFiles.contains("object") && allFiles.contains("words.tok") && allFiles.contains(Common::String(name) + "dir")) { |