aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2014-09-29 00:48:07 +0200
committerStrangerke2014-09-29 00:48:07 +0200
commit62b98913de165f6fd8663877911fe765fff9a852 (patch)
treec9ead816e1e36bf67f419eb0f0040f57e2b38f13 /engines
parent1fe9038918d70da23e55231784afc6f99578e764 (diff)
downloadscummvm-rg350-62b98913de165f6fd8663877911fe765fff9a852.tar.gz
scummvm-rg350-62b98913de165f6fd8663877911fe765fff9a852.tar.bz2
scummvm-rg350-62b98913de165f6fd8663877911fe765fff9a852.zip
MADS: Rex - Avoid potential not null terminated buffers after the use of strncpy
Diffstat (limited to 'engines')
-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 d76eb1279d..4f9493ade5 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -434,7 +434,7 @@ char TextView::_resourceName[100];
void TextView::execute(MADSEngine *vm, const Common::String &resName) {
assert(resName.size() < 100);
- strncpy(_resourceName, resName.c_str(), sizeof(_resourceName));
+ Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName));
vm->_dialogs->_pendingDialog = DIALOG_TEXTVIEW;
}
@@ -496,7 +496,7 @@ void TextView::processLines() {
processCommand();
// Copy rest of line (if any) to start of buffer
- strncpy(_currentLine, cEnd + 1, sizeof(_currentLine));
+ Common::strlcpy(_currentLine, cEnd + 1, sizeof(_currentLine));
cStart = strchr(_currentLine, '[');
}
@@ -788,7 +788,7 @@ char AnimationView::_resourceName[100];
void AnimationView::execute(MADSEngine *vm, const Common::String &resName) {
assert(resName.size() < 100);
- strncpy(_resourceName, resName.c_str(), sizeof(_resourceName));
+ Common::strlcpy(_resourceName, resName.c_str(), sizeof(_resourceName));
vm->_dialogs->_pendingDialog = DIALOG_ANIMVIEW;
}