Ticket #9216: scummvm-overflow.patch

File scummvm-overflow.patch, 1.3 KB (added by SF/reddwarf69, 14 years ago)

Patch over 1.2.0

  • engines/agi/predictive.cpp

    old new bool AgiEngine::predictiveDialog() {  
    461461        }
    462462
    463463 press:
    464         strncpy(_predictiveResult, prefix.c_str(), 40);
    465         strncat(_predictiveResult, _currentWord.c_str(), 40);
    466         _predictiveResult[prefix.size() + _currentCode.size() + 1] = 0;
     464        strncpy(_predictiveResult, prefix.c_str(), sizeof(_predictiveResult));
     465        _predictiveResult[sizeof(_predictiveResult) - 1]= 0;
     466        strncat(_predictiveResult, _currentWord.c_str(), sizeof(_predictiveResult)-strlen(_predictiveResult)-1);
     467        _predictiveResult[prefix.size() + _currentCode.size()] = 0;
    467468
    468469 getout:
    469470        // if another window was shown, bring it up again
  • engines/parallaction/balloons.cpp

    old new class BalloonManager_ns : public Balloon  
    248248        Parallaction_ns *_vm;
    249249        static int16 _dialogueBalloonX[5];
    250250
    251         byte _textColors[2];
     251        byte _textColors[3];
    252252
    253253        struct Balloon {
    254254                Common::Rect outerBox;
    public:  
    530530class BalloonManager_br : public BalloonManager {
    531531
    532532        Parallaction_br *_vm;
    533         byte _textColors[2];
     533        byte _textColors[3];
    534534
    535535        struct Balloon {
    536536                Common::Rect box;