aboutsummaryrefslogtreecommitdiff
path: root/cmd-command-prompt.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-07-20 15:51:32 +0000
committerTiago Cunha <tcunha@gmx.com>2009-07-20 15:51:32 +0000
commit62017452e958cd6fad19d5ca9c7eb56b63bf90a0 (patch)
tree82190dfe236317bd1860c26a8b4b97250bbc9afc /cmd-command-prompt.c
parent16f424d25dc843b70b17b7993ea0bdebcbda1c5e (diff)
downloadrtmux-62017452e958cd6fad19d5ca9c7eb56b63bf90a0.tar.gz
rtmux-62017452e958cd6fad19d5ca9c7eb56b63bf90a0.tar.bz2
rtmux-62017452e958cd6fad19d5ca9c7eb56b63bf90a0.zip
Sync OpenBSD patchset 145:
Kill some dead stores and fix a null pointer deref, found by clang.
Diffstat (limited to 'cmd-command-prompt.c')
-rw-r--r--cmd-command-prompt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c
index d59c51f7..f50408b6 100644
--- a/cmd-command-prompt.c
+++ b/cmd-command-prompt.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-command-prompt.c,v 1.19 2009-07-17 09:26:21 nicm Exp $ */
+/* $Id: cmd-command-prompt.c,v 1.20 2009-07-20 15:51:32 tcunha 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;
}