1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-29 01:42:32 +01:00

fixed a buffer overflow

This commit is contained in:
dan
2002-04-11 20:38:05 +00:00
parent 750917986e
commit ee5b28b0af
2 changed files with 3 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ Changes since version 0.80.0:
- Fixed a bug in wdread - Fixed a bug in wdread
- Fixed bug with windows that have WM_HINTS.take_focus = False. These windows - Fixed bug with windows that have WM_HINTS.take_focus = False. These windows
will not receive focus at all. will not receive focus at all.
- Fixed a buffer overflow in winmenu.c
Changes since version 0.70.0: Changes since version 0.70.0:

View File

@@ -239,12 +239,12 @@ updateWorkspaceMenu(WMenu *menu)
if (i < menu->entry_no) { if (i < menu->entry_no) {
if (strcmp(menu->entries[i]->text,scr->workspaces[i]->name)!=0) { if (strcmp(menu->entries[i]->text,scr->workspaces[i]->name)!=0) {
wfree(menu->entries[i]->text); 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->entries[i]->text = wstrdup(title);
menu->flags.realized = 0; menu->flags.realized = 0;
} }
} else { } else {
strcpy(title, scr->workspaces[i]->name); strncpy(title, scr->workspaces[i]->name, MAX_WORKSPACENAME_WIDTH);
wMenuAddCallback(menu, title, switchWSCommand, NULL); wMenuAddCallback(menu, title, switchWSCommand, NULL);