summaryrefslogtreecommitdiff
path: root/sshkey.c
diff options
context:
space:
mode:
authordtucker@openbsd.org <dtucker@openbsd.org>2017-03-10 03:48:57 +0000
committerDamien Miller <djm@mindrot.org>2017-03-10 15:35:38 +1100
commit7fadbb6da3f4122de689165651eb39985e1cba85 (patch)
treeffb067ba0eecf44dd9c70d49a9fa28a851ddf23f /sshkey.c
parent5a06b9e019e2b0b0f65a223422935b66f3749de3 (diff)
upstream commit
Check for NULL argument to sshkey_read. Patch from jjelen at redhat.com via bz#2687, ok djm@ Upstream-ID: c2d00c2ea50c4861d271d0a586f925cc64a87e0e
Diffstat (limited to 'sshkey.c')
-rw-r--r--sshkey.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sshkey.c b/sshkey.c
index 85fd1bd9..06e11c6c 100644
--- a/sshkey.c
+++ b/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.
@@ -1239,6 +1239,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) {