diff options
author | Di Ma <focus64@gmail.com> | 2020-03-22 16:25:27 -0700 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2020-04-14 19:41:30 -0400 |
commit | c0bce9138b9009724b8b5650ec2ec00b06b948b2 (patch) | |
tree | 88452db535eb5bb98b842a2ef26f84cd6bc82a78 /sway/commands | |
parent | 2bece94b9bf2cf099d2f166808385ce8a7940476 (diff) |
Fix a use-after-free error in switch binding
Diffstat (limited to 'sway/commands')
-rw-r--r-- | sway/commands/bind.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/bind.c b/sway/commands/bind.c index de2e7bd4..f903f939 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c @@ -608,7 +608,7 @@ void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding) return; } memcpy(deferred, binding, sizeof(struct sway_binding)); - deferred->command = strdup(binding->command); + deferred->command = binding->command ? strdup(binding->command) : NULL; list_add(seat->deferred_bindings, deferred); return; } |