agent: Fix auth key comment handling.
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 8 May 2014 02:46:38 +0000 (11:46 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 8 May 2014 02:46:38 +0000 (11:46 +0900)
* agent/command-ssh.c (ssh_send_key_public): Handle the case with no
comment.

agent/command-ssh.c

index a814681..d619324 100644 (file)
@@ -2331,7 +2331,9 @@ ssh_send_key_public (estream_t stream, gcry_sexp_t key,
   else
     {
       err = ssh_key_extract_comment (key, &comment);
-      if (!err)
+      if (err)
+        err = stream_write_cstring (stream, "(none)");
+      else
         err = stream_write_cstring (stream, comment);
     }
   if (err)