SHA256
1
0
forked from pool/scummvm
scummvm/scummvm-overflow.patch

41 lines
1.3 KiB
Diff

Index: engines/agi/predictive.cpp
===================================================================
--- engines/agi/predictive.cpp.orig
+++ engines/agi/predictive.cpp
@@ -461,9 +461,10 @@ bool AgiEngine::predictiveDialog() {
}
press:
- strncpy(_predictiveResult, prefix.c_str(), 40);
- strncat(_predictiveResult, _currentWord.c_str(), 40);
- _predictiveResult[prefix.size() + _currentCode.size() + 1] = 0;
+ strncpy(_predictiveResult, prefix.c_str(), sizeof(_predictiveResult));
+ _predictiveResult[sizeof(_predictiveResult) - 1]= 0;
+ strncat(_predictiveResult, _currentWord.c_str(), sizeof(_predictiveResult)-strlen(_predictiveResult)-1);
+ _predictiveResult[prefix.size() + _currentCode.size()] = 0;
getout:
// if another window was shown, bring it up again
Index: engines/parallaction/balloons.cpp
===================================================================
--- engines/parallaction/balloons.cpp.orig
+++ engines/parallaction/balloons.cpp
@@ -248,7 +248,7 @@ class BalloonManager_ns : public Balloon
Parallaction_ns *_vm;
static int16 _dialogueBalloonX[5];
- byte _textColors[2];
+ byte _textColors[3];
struct Balloon {
Common::Rect outerBox;
@@ -530,7 +530,7 @@ public:
class BalloonManager_br : public BalloonManager {
Parallaction_br *_vm;
- byte _textColors[2];
+ byte _textColors[3];
struct Balloon {
Common::Rect box;