From f475c9a8023e1649f1acc2955f6e5f14a07fdf12 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 20 Jul 2009 07:31:10 +0000 Subject: Kill some dead stores and fix a null pointer deref, found by clang. --- usr.bin/tmux/cmd-command-prompt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'usr.bin/tmux/cmd-command-prompt.c') 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 @@ -140,6 +140,8 @@ cmd_command_prompt_callback(void *data, const char *s) } } + if (buf == NULL) + return (0); buf[len] = '\0'; s = buf; } -- cgit v1.2.3-59-g8ed1b