mirror of
https://github.com/swaywm/sway.git
synced 2026-03-30 11:10:59 -04:00
Prevent invalid free of workspace name
An allocated pointer was incremented before being freed in `sway/workspace.c` which led to an invalid free. This has been fixed by keeping the pointer in place and moving the data instead. Fixes #1548
This commit is contained in:
parent
a74d1a1992
commit
be39e84875
1 changed files with 3 additions and 2 deletions
|
|
@ -68,8 +68,9 @@ char *workspace_next_name(const char *output_name) {
|
|||
sway_log(L_DEBUG, "Got valid workspace command for target: '%s'", name);
|
||||
char *_target = strdup(name);
|
||||
strip_quotes(_target);
|
||||
while (isspace(*_target))
|
||||
_target++;
|
||||
while (isspace(*_target)) {
|
||||
memmove(_target, _target+1, strlen(_target+1));
|
||||
}
|
||||
|
||||
// Make sure that the command references an actual workspace
|
||||
// not a command about workspaces
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue