summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2013-02-08 00:41:12 +0000
committerdjm <djm@openbsd.org>2013-02-08 00:41:12 +0000
commitefc7c334d60f6da056e51a7ad1c0c5b69173f88c (patch)
treee4c92913d53e9ceecff20cd8d817926b5ef4a27b
parentAdd relayd regression tests with http filter and late connect. (diff)
downloadwireguard-openbsd-efc7c334d60f6da056e51a7ad1c0c5b69173f88c.tar.xz
wireguard-openbsd-efc7c334d60f6da056e51a7ad1c0c5b69173f88c.zip
fix NULL deref when built without libedit and control characters
entered as command; debugging and patch from Iain Morgan an Loganaden Velvindron in bz#1956
-rw-r--r--usr.bin/ssh/sftp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/ssh/sftp.c b/usr.bin/ssh/sftp.c
index 90b752f72c9..a39a785d913 100644
--- a/usr.bin/ssh/sftp.c
+++ b/usr.bin/ssh/sftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sftp.c,v 1.141 2012/10/05 12:34:39 markus Exp $ */
+/* $OpenBSD: sftp.c,v 1.142 2013/02/08 00:41:12 djm Exp $ */
/*
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
*
@@ -1122,7 +1122,7 @@ parse_args(const char **cpp, int *pflag, int *rflag, int *lflag, int *iflag,
/* Figure out which command we have */
for (i = 0; cmds[i].c != NULL; i++) {
- if (strcasecmp(cmds[i].c, argv[0]) == 0)
+ if (argv[0] != NULL && strcasecmp(cmds[i].c, argv[0]) == 0)
break;
}
cmdnum = cmds[i].n;