From b51568ddaf96f77c7993afe44e801193b38f0cb4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 19 Feb 2010 22:26:30 +0000 Subject: Increased the amount of space for storing background filenames to fix memory overflow svn-id: r48091 --- engines/cruise/background.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'engines/cruise/background.cpp') diff --git a/engines/cruise/background.cpp b/engines/cruise/background.cpp index e8f0865270..a32973eb54 100644 --- a/engines/cruise/background.cpp +++ b/engines/cruise/background.cpp @@ -210,8 +210,12 @@ int loadBackground(const char *name, int idx) { MemFree(ptrToFree); - if (name != backgroundTable[idx].name) - strcpy(backgroundTable[idx].name, name); + if (name != backgroundTable[idx].name) { + if (strlen(name) > sizeof(backgroundTable[idx].name)) + warning("background name length exceeded allowable maximum"); + + strncpy(backgroundTable[idx].name, name, sizeof(backgroundTable[idx].name)); + } return (0); } -- cgit v1.2.3