summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@cvs.openbsd.org>2022-06-18 02:17:17 +0000
committerDarren Tucker <dtucker@cvs.openbsd.org>2022-06-18 02:17:17 +0000
commit64c0ca569b8e45312dcfb0eac26658b6505a95d2 (patch)
tree0105ecafb3db6eb7a1424c1e802dbca6612876f4
parent2cf14816f0d6cdd9e9999ada5ad4fa47d190c36b (diff)
Don't attempt to fprintf a null identity comment. From Martin Vahlensieck
via tech@.
-rw-r--r--usr.bin/ssh/ssh-add.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c
index c206118a320..03afd1d1df5 100644
--- a/usr.bin/ssh/ssh-add.c
+++ b/usr.bin/ssh/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.165 2022/02/04 02:49:17 dtucker Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.166 2022/06/18 02:17:16 dtucker Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -118,7 +118,7 @@ delete_one(int agent_fd, const struct sshkey *key, const char *comment,
}
if (!qflag) {
fprintf(stderr, "Identity removed: %s %s (%s)\n", path,
- sshkey_type(key), comment);
+ sshkey_type(key), comment ? comment : "no comment");
}
return 0;
}
@@ -392,7 +392,7 @@ add_file(int agent_fd, const char *filename, int key_only, int qflag,
certpath, filename);
sshkey_free(cert);
goto out;
- }
+ }
/* Graft with private bits */
if ((r = sshkey_to_certified(private)) != 0) {