diff options
author | 2009-07-20 07:31:10 +0000 | |
---|---|---|
committer | 2009-07-20 07:31:10 +0000 | |
commit | f475c9a8023e1649f1acc2955f6e5f14a07fdf12 (patch) | |
tree | 50abe8012f22ecd0255f97e4fa84e9f65e9ec170 /usr.bin/tmux/cmd-command-prompt.c | |
parent | Move the offsets as well when swapping panes. (diff) | |
download | wireguard-openbsd-f475c9a8023e1649f1acc2955f6e5f14a07fdf12.tar.xz wireguard-openbsd-f475c9a8023e1649f1acc2955f6e5f14a07fdf12.zip |
Kill some dead stores and fix a null pointer deref, found by clang.
Diffstat (limited to 'usr.bin/tmux/cmd-command-prompt.c')
-rw-r--r-- | usr.bin/tmux/cmd-command-prompt.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/cmd-command-prompt.c b/usr.bin/tmux/cmd-command-prompt.c index f0e6e9d5948..be532a75738 100644 --- a/usr.bin/tmux/cmd-command-prompt.c +++ b/usr.bin/tmux/cmd-command-prompt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-command-prompt.c,v 1.4 2009/07/17 06:13:27 nicm Exp $ */ +/* $OpenBSD: cmd-command-prompt.c,v 1.5 2009/07/20 07:31:10 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -140,6 +140,8 @@ cmd_command_prompt_callback(void *data, const char *s) } } + if (buf == NULL) + return (0); buf[len] = '\0'; s = buf; } |