[Scummvm-cvs-logs] scummvm master -> f24346aad7a773c127a6b557c984ee8140b705a5
Strangerke
Strangerke at scummvm.org
Wed Aug 6 19:08:35 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
f24346aad7 MADS: Avoid potential buffer overflows
Commit: f24346aad7a773c127a6b557c984ee8140b705a5
https://github.com/scummvm/scummvm/commit/f24346aad7a773c127a6b557c984ee8140b705a5
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-08-06T19:06:19+02:00
Commit Message:
MADS: Avoid potential buffer overflows
Changed paths:
engines/mads/nebular/menu_nebular.cpp
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index cb8f56b..4743ec4 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;
}
More information about the Scummvm-git-logs
mailing list