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

Coverity: fix potential buffer overflow

This commit is contained in:
David Maciejak
2023-02-28 21:24:31 +08:00
committed by Carlos R. Mafra
parent 7b317a5fba
commit d2d5297a1e
4 changed files with 4 additions and 4 deletions

View File

@@ -997,7 +997,7 @@ static void updateWorkspaceNames(WScreen *scr)
len = 0;
for (i = 0; i < scr->workspace_count; i++) {
curr_size = strlen(scr->workspaces[i]->name);
strcpy(pos, scr->workspaces[i]->name);
strncpy(pos, scr->workspaces[i]->name, sizeof(pos) - 1);
pos += (curr_size + 1);
len += (curr_size + 1);
}