]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Don't attempt to fprintf a null identity comment. From
authordtucker@openbsd.org <dtucker@openbsd.org>
Sat, 18 Jun 2022 02:17:16 +0000 (02:17 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 24 Jun 2022 04:28:29 +0000 (14:28 +1000)
Martin Vahlensieck via tech@.

OpenBSD-Commit-ID: 4c54d20a8e8e4e9912c38a7b4ef5bfc5ca2e05c2

ssh-add.c

index 7555477482766e4464ab92bcbf19a879fe28d4f1..777f21e26b01edafe65f581af335e71fe24a4592 100644 (file)
--- a/ssh-add.c
+++ b/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
@@ -125,7 +125,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;
 }
@@ -399,7 +399,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) {