aboutsummaryrefslogtreecommitdiff
path: root/engines/mads
diff options
context:
space:
mode:
authorStrangerke2014-08-06 19:06:19 +0200
committerStrangerke2014-08-06 19:06:19 +0200
commitf24346aad7a773c127a6b557c984ee8140b705a5 (patch)
treed6939d154de7811d6d4da340a4c38fc0bd8c7844 /engines/mads
parente8cb2a37bdecc8c52cd4fa53e8f4612ec5be9d5a (diff)
downloadscummvm-rg350-f24346aad7a773c127a6b557c984ee8140b705a5.tar.gz
scummvm-rg350-f24346aad7a773c127a6b557c984ee8140b705a5.tar.bz2
scummvm-rg350-f24346aad7a773c127a6b557c984ee8140b705a5.zip
MADS: Avoid potential buffer overflows
Diffstat (limited to 'engines/mads')
-rw-r--r--engines/mads/nebular/menu_nebular.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index cb8f56bd05..4743ec4743 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -408,7 +408,7 @@ char TextView::_resourceName[100];
void TextView::execute(MADSEngine *vm, const Common::String &resName) {
assert(resName.size() < 100);
- strcpy(_resourceName, resName.c_str());
+ strncpy(_resourceName, resName.c_str(), sizeof(_resourceName));
vm->_dialogs->_pendingDialog = DIALOG_TEXTVIEW;
}
@@ -460,7 +460,7 @@ void TextView::processLines() {
processCommand();
// Copy rest of line (if any) to start of buffer
- strcpy(_currentLine, cEnd + 1);
+ strncpy(_currentLine, cEnd + 1, sizeof(_currentLine));
cStart = strchr(_currentLine, '[');
}
@@ -631,7 +631,7 @@ char AnimationView::_resourceName[100];
void AnimationView::execute(MADSEngine *vm, const Common::String &resName) {
assert(resName.size() < 100);
- strcpy(_resourceName, resName.c_str());
+ strncpy(_resourceName, resName.c_str(), sizeof(_resourceName));
vm->_dialogs->_pendingDialog = DIALOG_ANIMVIEW;
}