diff options
author | Johannes Schickel | 2010-10-11 17:07:53 +0000 |
---|---|---|
committer | Johannes Schickel | 2010-10-11 17:07:53 +0000 |
commit | cc0afa92b32661c7c71049aa33a7764b0f9ffa4b (patch) | |
tree | 09ca290a7609c23e0547492ce1832dc66a4dddc7 /engines/agi | |
parent | c3366755ef6f0614ccc97ad41caaf39c026a3c31 (diff) | |
download | scummvm-rg350-cc0afa92b32661c7c71049aa33a7764b0f9ffa4b.tar.gz scummvm-rg350-cc0afa92b32661c7c71049aa33a7764b0f9ffa4b.tar.bz2 scummvm-rg350-cc0afa92b32661c7c71049aa33a7764b0f9ffa4b.zip |
AGI: Fix possible buffer overflow.
This is based on patch #3085298 "overflows in agi and parallaction".
svn-id: r53147
Diffstat (limited to 'engines/agi')
-rw-r--r-- | engines/agi/predictive.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp index 820aad3883..fe92bcd963 100644 --- a/engines/agi/predictive.cpp +++ b/engines/agi/predictive.cpp @@ -461,9 +461,8 @@ bool AgiEngine::predictiveDialog() { } press: - strncpy(_predictiveResult, prefix.c_str(), 40); - strncat(_predictiveResult, _currentWord.c_str(), 40); - _predictiveResult[prefix.size() + _currentCode.size() + 1] = 0; + Common::strlcpy(_predictiveResult, prefix.c_str(), sizeof(_predictiveResult)); + Common::strlcat(_predictiveResult, _currentWord.c_str(), sizeof(_predictiveResult)); getout: // if another window was shown, bring it up again |