aboutsummaryrefslogtreecommitdiff
path: root/engines/cruise/background.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cruise/background.cpp')
-rw-r--r--engines/cruise/background.cpp8
1 files changed, 6 insertions, 2 deletions
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);
}