diff options
author | Torbjörn Andersson | 2014-08-06 17:32:19 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2014-08-06 17:34:43 +0200 |
commit | e8cb2a37bdecc8c52cd4fa53e8f4612ec5be9d5a (patch) | |
tree | 30691c52c2e46c592f61e0e220757ce468adc1c7 /engines | |
parent | ea2ee4ada7a55ba4b4e65eaa649464f4b4242b01 (diff) | |
download | scummvm-rg350-e8cb2a37bdecc8c52cd4fa53e8f4612ec5be9d5a.tar.gz scummvm-rg350-e8cb2a37bdecc8c52cd4fa53e8f4612ec5be9d5a.tar.bz2 scummvm-rg350-e8cb2a37bdecc8c52cd4fa53e8f4612ec5be9d5a.zip |
ZVISION: Silence Cppcheck warnings about buffer overflow
I don't know if it's the buffer sizes or the format strings that
should be fixed, but increasing the buffer size seems like the safer
thing to do in cases of doubt.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/scripting/actions.cpp | 12 | ||||
-rw-r--r-- | engines/zvision/scripting/controls/input_control.cpp | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/engines/zvision/scripting/actions.cpp b/engines/zvision/scripting/actions.cpp index e854378ae4..517278e155 100644 --- a/engines/zvision/scripting/actions.cpp +++ b/engines/zvision/scripting/actions.cpp @@ -155,7 +155,7 @@ bool ActionEnableControl::execute(ZVision *engine) { ActionMusic::ActionMusic(const Common::String &line) : _volume(255) { uint type; - char fileNameBuffer[25]; + char fileNameBuffer[26]; uint loop; uint volume = 255; @@ -211,7 +211,7 @@ bool ActionMusic::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// ActionPreloadAnimation::ActionPreloadAnimation(const Common::String &line) { - char fileName[25]; + char fileName[26]; // The two %*u are always 0 and dont seem to have a use sscanf(line.c_str(), "%*[^:]:%*[^:]:%u(%25s %*u %*u %u %u)", &_key, fileName, &_mask, &_framerate); @@ -238,7 +238,7 @@ bool ActionPreloadAnimation::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// ActionPlayAnimation::ActionPlayAnimation(const Common::String &line) { - char fileName[25]; + char fileName[26]; // The two %*u are always 0 and dont seem to have a use sscanf(line.c_str(), @@ -312,7 +312,7 @@ bool ActionRandom::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// ActionSetPartialScreen::ActionSetPartialScreen(const Common::String &line) { - char fileName[25]; + char fileName[26]; uint color; sscanf(line.c_str(), "%*[^(](%u %u %25s %*u %u)", &_x, &_y, fileName, &color); @@ -342,7 +342,7 @@ bool ActionSetPartialScreen::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// ActionSetScreen::ActionSetScreen(const Common::String &line) { - char fileName[25]; + char fileName[26]; sscanf(line.c_str(), "%*[^(](%25[^)])", fileName); _fileName = Common::String(fileName); @@ -360,7 +360,7 @@ bool ActionSetScreen::execute(ZVision *engine) { ////////////////////////////////////////////////////////////////////////////// ActionStreamVideo::ActionStreamVideo(const Common::String &line) { - char fileName[25]; + char fileName[26]; uint skippable; sscanf(line.c_str(), "%*[^(](%25s %u %u %u %u %u %u)", fileName, &_x1, &_y1, &_x2, &_y2, &_flags, &skippable); diff --git a/engines/zvision/scripting/controls/input_control.cpp b/engines/zvision/scripting/controls/input_control.cpp index 5cf5086691..a35548d02e 100644 --- a/engines/zvision/scripting/controls/input_control.cpp +++ b/engines/zvision/scripting/controls/input_control.cpp @@ -75,7 +75,7 @@ InputControl::InputControl(ZVision *engine, uint32 key, Common::SeekableReadStre } else if (line.matchString("*next_tabstop*", true)) { sscanf(line.c_str(), "%*[^(](%u)", &_nextTabstop); } else if (line.matchString("*cursor_animation*", true)) { - char fileName[25]; + char fileName[26]; sscanf(line.c_str(), "%*[^(](%25s %*u)", fileName); |