diff --git a/ChangeLog b/ChangeLog index 0ae4f8ad..4489eae0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -44,6 +44,7 @@ Changes since version 0.80.0: - Fixed a bug in wdread - Fixed bug with windows that have WM_HINTS.take_focus = False. These windows will not receive focus at all. +- Fixed a buffer overflow in winmenu.c Changes since version 0.70.0: diff --git a/src/winmenu.c b/src/winmenu.c index 23f8f4c2..0d97bd67 100644 --- a/src/winmenu.c +++ b/src/winmenu.c @@ -239,12 +239,12 @@ updateWorkspaceMenu(WMenu *menu) if (i < menu->entry_no) { if (strcmp(menu->entries[i]->text,scr->workspaces[i]->name)!=0) { wfree(menu->entries[i]->text); - strcpy(title, scr->workspaces[i]->name); + strncpy(title, scr->workspaces[i]->name, MAX_WORKSPACENAME_WIDTH); menu->entries[i]->text = wstrdup(title); menu->flags.realized = 0; } } else { - strcpy(title, scr->workspaces[i]->name); + strncpy(title, scr->workspaces[i]->name, MAX_WORKSPACENAME_WIDTH); wMenuAddCallback(menu, title, switchWSCommand, NULL);