summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordtucker <dtucker@openbsd.org>2017-03-10 03:48:57 +0000
committerdtucker <dtucker@openbsd.org>2017-03-10 03:48:57 +0000
commite5eb81a081ec55c11d419588e7d81a6a8498fc96 (patch)
treec37b4f43068c3fcd68aa167964fffdc6334249ab
parentPlug some mem leaks mostly on error paths. From jjelen at redhat.com (diff)
downloadwireguard-openbsd-e5eb81a081ec55c11d419588e7d81a6a8498fc96.tar.xz
wireguard-openbsd-e5eb81a081ec55c11d419588e7d81a6a8498fc96.zip
Check for NULL argument to sshkey_read. Patch from jjelen at redhat.com
via bz#2687, ok djm@
-rw-r--r--usr.bin/ssh/sshkey.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c
index f28cd4f5670..11e440fd2fa 100644
--- a/usr.bin/ssh/sshkey.c
+++ b/usr.bin/ssh/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.43 2017/02/17 02:31:14 dtucker Exp $ */
+/* $OpenBSD: sshkey.c,v 1.44 2017/03/10 03:48:57 dtucker Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -1213,6 +1213,9 @@ sshkey_read(struct sshkey *ret, char **cpp)
u_long bits;
#endif /* WITH_SSH1 */
+ if (ret == NULL)
+ return SSH_ERR_INVALID_ARGUMENT;
+
cp = *cpp;
switch (ret->type) {