From 8e7279f5ac0ced6a0ff458cbed7a54b5f547ab66 Mon Sep 17 00:00:00 2001 From: uruk Date: Wed, 13 Aug 2014 18:18:26 +0200 Subject: CGE2: Fix possible string overflow in setEye(). --- engines/cge2/cge2_main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engines') 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) { -- cgit v1.2.3