Merge pull request #1559 from 4e554c4c/invalid_free

Prevent invalid free of workspace name
This commit is contained in:
Drew DeVault 2018-01-06 21:55:06 -05:00 committed by GitHub
commit c6d54f364f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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