summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keygen.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2017-02-08 20:32:43 +0000
committermillert <millert@openbsd.org>2017-02-08 20:32:43 +0000
commit1a32d4ee5b7d1ef60de3788c97cb5b2eb9936fb1 (patch)
tree5c219c4abdf44a457809582fec1b00dbcfcc39e4 /usr.bin/ssh/ssh-keygen.c
parentAvoid a busy loop in netcat's tls_close(). Reuse the tls_handshake() (diff)
downloadwireguard-openbsd-1a32d4ee5b7d1ef60de3788c97cb5b2eb9936fb1.tar.xz
wireguard-openbsd-1a32d4ee5b7d1ef60de3788c97cb5b2eb9936fb1.zip
Avoid printf %s NULL. From semarie@, OK djm@
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r--usr.bin/ssh/ssh-keygen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 65b3f0ed6ab..f9ee8ca38d6 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.292 2016/09/12 03:29:16 dtucker Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.293 2017/02/08 20:32:43 millert Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1425,7 +1425,10 @@ do_change_comment(struct passwd *pw)
sshkey_free(private);
exit(1);
}
- printf("Key now has comment '%s'\n", comment);
+ if (comment)
+ printf("Key now has comment '%s'\n", comment);
+ else
+ printf("Key now has no comment\n");
if (identity_comment) {
strlcpy(new_comment, identity_comment, sizeof(new_comment));