- djm@cvs.openbsd.org 2013/02/08 00:41:12

[sftp.c]
     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
This commit is contained in:
Damien Miller 2013-02-12 11:02:46 +11:00
parent 18de9133c2
commit d6d9fa0281
2 changed files with 7 additions and 2 deletions

View File

@ -31,6 +31,11 @@
- dtucker@cvs.openbsd.org 2013/02/06 00:22:21 - dtucker@cvs.openbsd.org 2013/02/06 00:22:21
[auth.c] [auth.c]
Fix comment, from jfree.e1 at gmail Fix comment, from jfree.e1 at gmail
- djm@cvs.openbsd.org 2013/02/08 00:41:12
[sftp.c]
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
20130211 20130211
- (djm) [configure.ac openbsd-compat/openssl-compat.h] Repair build on old - (djm) [configure.ac openbsd-compat/openssl-compat.h] Repair build on old

4
sftp.c
View File

@ -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> * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
* *
@ -1145,7 +1145,7 @@ parse_args(const char **cpp, int *pflag, int *rflag, int *lflag, int *iflag,
/* Figure out which command we have */ /* Figure out which command we have */
for (i = 0; cmds[i].c != NULL; i++) { 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; break;
} }
cmdnum = cmds[i].n; cmdnum = cmds[i].n;