mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-26 00:12:31 +01:00
fixed a buffer overflow
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user