Fix buffer overflow when displaying a scrolling background

This commit is contained in:
Gustaf Alhäll 2023-06-03 13:05:33 +02:00
parent d6d424f102
commit 7c75f61be7
No known key found for this signature in database
GPG key ID: 6C1F67D690CDEDFD

View file

@ -2807,6 +2807,7 @@ void M_SetMenuCurBackground(const char *defaultname)
{ {
char name[9]; char name[9];
strncpy(name, defaultname, 8); strncpy(name, defaultname, 8);
name[8] = '\0';
M_IterateMenuTree(MIT_SetCurBackground, &name); M_IterateMenuTree(MIT_SetCurBackground, &name);
} }