]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: reset comment=NULL for each key in do_fingerprint();
authordjm@openbsd.org <djm@openbsd.org>
Tue, 20 Jun 2023 00:05:09 +0000 (00:05 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 20 Jun 2023 00:07:06 +0000 (10:07 +1000)
fixes "no comment" not showing on when running `ssh-keygen -l` on multiple
keys where one has a comment and other following keys do not. Patch from
Markus Kuhn via GHPR407, bz3580

OpenBSD-Commit-ID: 3cce84456fdcd67dc6b84e369f92c6686d111d9b

ssh-keygen.c

index 3a0ba8b9e2d86c8dde297c12b33bfcb23a8616d5..fd2725c25a9d2f2e9a4648bab4ffd4ed5da4b6b8 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.467 2023/04/12 08:53:54 jsg Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.468 2023/06/20 00:05:09 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -997,6 +997,7 @@ do_fingerprint(struct passwd *pw)
                 * accept a public key prefixed with a hostname or options.
                 * Try a bare key first, otherwise skip the leading stuff.
                 */
+               comment = NULL;
                if ((public = try_read_key(&cp)) == NULL) {
                        i = strtol(cp, &ep, 10);
                        if (i == 0 || ep == NULL ||