mirror of
https://github.com/tmux/tmux.git
synced 2024-12-24 01:58:46 +00:00
Fix a use-after-free when cancelling copy mode, or trying to repeat cancel.
ok kettenis
This commit is contained in:
parent
7bc3f5dd8a
commit
48dd72005e
@ -256,9 +256,8 @@ window_copy_key(struct window_pane *wp, struct client *c, int key)
|
||||
cmd = mode_key_lookup(&data->mdata, key);
|
||||
switch (cmd) {
|
||||
case MODEKEYCOPY_CANCEL:
|
||||
for (; np != 0; np--)
|
||||
window_pane_reset_mode(wp);
|
||||
break;
|
||||
window_pane_reset_mode(wp);
|
||||
return;
|
||||
case MODEKEYCOPY_LEFT:
|
||||
for (; np != 0; np--)
|
||||
window_copy_cursor_left(wp);
|
||||
@ -366,6 +365,7 @@ window_copy_key(struct window_pane *wp, struct client *c, int key)
|
||||
if (c != NULL && c->session != NULL) {
|
||||
window_copy_copy_selection(wp, c);
|
||||
window_pane_reset_mode(wp);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case MODEKEYCOPY_STARTOFLINE:
|
||||
|
Loading…
Reference in New Issue
Block a user