diff options
author | uruk | 2014-08-13 18:18:26 +0200 |
---|---|---|
committer | uruk | 2014-08-13 18:18:26 +0200 |
commit | 8e7279f5ac0ced6a0ff458cbed7a54b5f547ab66 (patch) | |
tree | e9d0f14d1aba5262abcd77cf726e670c52ef935b /engines | |
parent | 45e8078dab1be71a9ef5d125fa80ff660aa0cd5c (diff) | |
download | scummvm-rg350-8e7279f5ac0ced6a0ff458cbed7a54b5f547ab66.tar.gz scummvm-rg350-8e7279f5ac0ced6a0ff458cbed7a54b5f547ab66.tar.bz2 scummvm-rg350-8e7279f5ac0ced6a0ff458cbed7a54b5f547ab66.zip |
CGE2: Fix possible string overflow in setEye().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2_main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 7c4a111d1f..328af08f53 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -777,11 +777,12 @@ void CGE2Engine::setEye(const V2D& e2, int z) { } void CGE2Engine::setEye(const char *s) { - char tempStr[kLineMax]; + char *tempStr = new char[strlen(s) + 1]; strcpy(tempStr, s); _eye->_x = atoi(token(tempStr)); _eye->_y = atoi(token(nullptr)); _eye->_z = atoi(token(nullptr)); + delete[] tempStr; } int CGE2Engine::newRandom(int range) { |