Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/crypto/external/bsd/openssh/dist/authfile.c,v rcsdiff: /ftp/cvs/cvsroot/src/crypto/external/bsd/openssh/dist/authfile.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.1.1.12 retrieving revision 1.1.1.13 diff -u -p -r1.1.1.12 -r1.1.1.13 --- src/crypto/external/bsd/openssh/dist/authfile.c 2016/03/11 01:49:57 1.1.1.12 +++ src/crypto/external/bsd/openssh/dist/authfile.c 2016/08/02 13:29:09 1.1.1.13 @@ -1,4 +1,4 @@ -/* $OpenBSD: authfile.c,v 1.120 2015/12/11 04:21:11 mmcc Exp $ */ +/* $OpenBSD: authfile.c,v 1.121 2016/04/09 12:39:30 djm Exp $ */ /* * Copyright (c) 2000, 2013 Markus Friedl. All rights reserved. * @@ -145,7 +145,8 @@ sshkey_load_public_rsa1(int fd, struct s struct sshbuf *b = NULL; int r; - *keyp = NULL; + if (keyp != NULL) + *keyp = NULL; if (commentp != NULL) *commentp = NULL; @@ -195,7 +196,8 @@ sshkey_load_private_type(int type, const { int fd, r; - *keyp = NULL; + if (keyp != NULL) + *keyp = NULL; if (commentp != NULL) *commentp = NULL; @@ -226,6 +228,8 @@ sshkey_load_private_type_fd(int fd, int struct sshbuf *buffer = NULL; int r; + if (keyp != NULL) + *keyp = NULL; if ((buffer = sshbuf_new()) == NULL) { r = SSH_ERR_ALLOC_FAIL; goto out; @@ -250,7 +254,8 @@ sshkey_load_private(const char *filename struct sshbuf *buffer = NULL; int r, fd; - *keyp = NULL; + if (keyp != NULL) + *keyp = NULL; if (commentp != NULL) *commentp = NULL; @@ -403,7 +408,8 @@ sshkey_load_cert(const char *filename, s char *file = NULL; int r = SSH_ERR_INTERNAL_ERROR; - *keyp = NULL; + if (keyp != NULL) + *keyp = NULL; if (asprintf(&file, "%s-cert.pub", filename) == -1) return SSH_ERR_ALLOC_FAIL; @@ -413,11 +419,12 @@ sshkey_load_cert(const char *filename, s } if ((r = sshkey_try_load_public(pub, file, NULL)) != 0) goto out; - - *keyp = pub; - pub = NULL; + /* success */ + if (keyp != NULL) { + *keyp = pub; + pub = NULL; + } r = 0; - out: free(file); sshkey_free(pub); @@ -432,7 +439,8 @@ sshkey_load_private_cert(int type, const struct sshkey *key = NULL, *cert = NULL; int r; - *keyp = NULL; + if (keyp != NULL) + *keyp = NULL; switch (type) { #ifdef WITH_OPENSSL @@ -462,8 +470,10 @@ sshkey_load_private_cert(int type, const (r = sshkey_cert_copy(cert, key)) != 0) goto out; r = 0; - *keyp = key; - key = NULL; + if (keyp != NULL) { + *keyp = key; + key = NULL; + } out: sshkey_free(key); sshkey_free(cert);