summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2015-10-15 23:08:24 +0000
committerDamien Miller <djm@cvs.openbsd.org>2015-10-15 23:08:24 +0000
commit539c7163249ee18c5c151f1958f3892a3b57c031 (patch)
tree2580b6244bef9d3041d6cb067a050271fa740891
parent251fe6cc5756e32d3132fccf62d0d2d1cfbd5077 (diff)
argument to sshkey_from_private() and sshkey_demote() can't be NULL
-rw-r--r--usr.bin/ssh/sshkey.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c
index c73c77f3962..bebfca38aeb 100644
--- a/usr.bin/ssh/sshkey.c
+++ b/usr.bin/ssh/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.23 2015/09/13 14:39:16 tim Exp $ */
+/* $OpenBSD: sshkey.c,v 1.24 2015/10/15 23:08:23 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -1724,9 +1724,7 @@ sshkey_from_private(const struct sshkey *k, struct sshkey **pkp)
struct sshkey *n = NULL;
int ret = SSH_ERR_INTERNAL_ERROR;
- if (pkp != NULL)
- *pkp = NULL;
-
+ *pkp = NULL;
switch (k->type) {
#ifdef WITH_OPENSSL
case KEY_DSA:
@@ -2201,9 +2199,7 @@ sshkey_demote(const struct sshkey *k, struct sshkey **dkp)
struct sshkey *pk;
int ret = SSH_ERR_INTERNAL_ERROR;
- if (dkp != NULL)
- *dkp = NULL;
-
+ *dkp = NULL;
if ((pk = calloc(1, sizeof(*pk))) == NULL)
return SSH_ERR_ALLOC_FAIL;
pk->type = k->type;