summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert@openbsd.org <millert@openbsd.org>2017-02-08 20:32:43 +0000
committerDamien Miller <djm@mindrot.org>2017-02-10 14:37:26 +1100
commite40269be388972848aafcca7060111c70aab5b87 (patch)
treec1486993368260473e28e1425f1c2e4892bd4f0d
parent5b90709ab8704dafdb31e5651073b259d98352bc (diff)
upstream commit
Avoid printf %s NULL. From semarie@, OK djm@ Upstream-ID: 06beef7344da0208efa9275d504d60d2a5b9266c
-rw-r--r--ssh-keygen.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 2a7939bf..ced047c0 100644
--- a/ssh-keygen.c
+++ b/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
@@ -1441,7 +1441,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));