mirror of
https://github.com/tmux/tmux.git
synced 2024-12-14 02:48:47 +00:00
Add a couple of NULL pointer checks to key binding functions, from
jspenguin on SF bug 3535531.
This commit is contained in:
parent
a4a2c68fa9
commit
a13b4a819a
@ -207,6 +207,9 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
char *msg;
|
char *msg;
|
||||||
|
|
||||||
|
if (ctx->curclient->session == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
xvasprintf(&msg, fmt, ap);
|
xvasprintf(&msg, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
@ -219,9 +222,13 @@ key_bindings_error(struct cmd_ctx *ctx, const char *fmt, ...)
|
|||||||
void printflike2
|
void printflike2
|
||||||
key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...)
|
key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
struct winlink *wl = ctx->curclient->session->curw;
|
struct winlink *wl;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
||||||
|
if (ctx->curclient->session == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wl = ctx->curclient->session->curw;
|
||||||
if (wl->window->active->mode != &window_copy_mode) {
|
if (wl->window->active->mode != &window_copy_mode) {
|
||||||
window_pane_reset_mode(wl->window->active);
|
window_pane_reset_mode(wl->window->active);
|
||||||
window_pane_set_mode(wl->window->active, &window_copy_mode);
|
window_pane_set_mode(wl->window->active, &window_copy_mode);
|
||||||
@ -239,6 +246,9 @@ key_bindings_info(struct cmd_ctx *ctx, const char *fmt, ...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
char *msg;
|
char *msg;
|
||||||
|
|
||||||
|
if (ctx->curclient->session == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (options_get_number(&global_options, "quiet"))
|
if (options_get_number(&global_options, "quiet"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user