diff options
author | uruk | 2014-08-13 19:40:15 +0200 |
---|---|---|
committer | uruk | 2014-08-13 19:40:15 +0200 |
commit | 8b1ffab95bd1055bc73e3a0df0a59d994d5acd63 (patch) | |
tree | 6fa2d0e34a5393f8d2badd4ad50a1383be06a0a1 /engines | |
parent | 8e7279f5ac0ced6a0ff458cbed7a54b5f547ab66 (diff) | |
download | scummvm-rg350-8b1ffab95bd1055bc73e3a0df0a59d994d5acd63.tar.gz scummvm-rg350-8b1ffab95bd1055bc73e3a0df0a59d994d5acd63.tar.bz2 scummvm-rg350-8b1ffab95bd1055bc73e3a0df0a59d994d5acd63.zip |
CGE2: Fix possible string overflow in Bitmap's constructor.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/bitmap.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/engines/cge2/bitmap.cpp b/engines/cge2/bitmap.cpp index 01e97ebc53..236b86e779 100644 --- a/engines/cge2/bitmap.cpp +++ b/engines/cge2/bitmap.cpp @@ -43,27 +43,27 @@ void Bitmap::setVM(CGE2Engine *vm) { } Bitmap::Bitmap(CGE2Engine *vm, const char *fname) : _v(nullptr), _b(nullptr), _map(0), _vm(vm) { - char pat[kMaxPath]; + Common::String path; if (!strcmp(fname, "04tal201")) { - strcpy(pat, "04tal202"); + path = "04tal202"; warning("Workaround for missing VBM: 04tal201"); } else if (!strcmp(fname, "11oqlist-")) { - strcpy(pat, "11oqlist"); + path = "11oqlist"; warning("Workaround for wrong VBM name: 11oqlist-"); } else - strcpy(pat, fname); + path = fname; - strcpy(pat, setExtension(pat, ".VBM").c_str()); + path = setExtension(path, ".VBM"); - if (_vm->_resman->exist(pat)) { - EncryptedStream file(_vm, pat); + if (_vm->_resman->exist(path.c_str())) { + EncryptedStream file(_vm, path.c_str()); if (file.err()) error("Unable to find VBM [%s]", fname); if (!loadVBM(&file)) error("Bad VBM [%s]", fname); } else { - warning("Missing VBM [%s]", pat); + warning("Missing VBM [%s]", path.c_str()); } } |