[openssh-commits] [openssh] 01/04: upstream: Bump size of key comment buffers. Prevents warnings on

git+noreply at mindrot.org git+noreply at mindrot.org
Wed Sep 2 19:14:57 AEST 2026


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 116752913a37a25ff19387c4f807dd2a44775eca
Author: dtucker at openbsd.org <dtucker at openbsd.org>
AuthorDate: Sat Aug 22 12:48:18 2026 +0000

    upstream: Bump size of key comment buffers. Prevents warnings on
    
    some platforms. ok djm@
    
    OpenBSD-Commit-ID: 020416d345c31e967f07a3e483d2e5b8e5bfa5c7
---
 ssh-keygen.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ssh-keygen.c b/ssh-keygen.c
index 6667a5c1b..be782df31 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.493 2026/08/07 05:49:53 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.494 2026/08/22 12:48:18 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1994 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -80,6 +80,8 @@
 #define DEFAULT_BITS		3072
 #define DEFAULT_BITS_ECDSA	256
 
+#define KEY_COMMENT_MAX		(NI_MAXHOST + 1024)
+
 static int quiet = 0;
 
 /* Flag indicating that we just want to see the key fingerprint */
@@ -1013,7 +1015,7 @@ do_gen_all_hostkeys(struct passwd *pw)
 	int first = 0;
 	struct stat st;
 	struct sshkey *private, *public;
-	char comment[1024], *prv_tmp, *pub_tmp, *prv_file, *pub_file;
+	char comment[KEY_COMMENT_MAX], *prv_tmp, *pub_tmp, *prv_file, *pub_file;
 	int i, type, fd, r;
 
 	for (i = 0; key_types[i].key_type; i++) {
@@ -1501,7 +1503,7 @@ do_print_resource_record(struct passwd *pw, char *fname, char *hname,
 static void
 do_change_comment(struct passwd *pw, const char *identity_comment)
 {
-	char new_comment[1024], *comment, *passphrase;
+	char new_comment[KEY_COMMENT_MAX], *comment, *passphrase;
 	struct sshkey *private;
 	struct sshkey *public;
 	struct stat st;
@@ -3312,7 +3314,7 @@ usage(void)
 int
 main(int argc, char **argv)
 {
-	char comment[1024], *passphrase = NULL;
+	char comment[KEY_COMMENT_MAX], *passphrase = NULL;
 	char *rr_hostname = NULL, *ep, *fp, *ra;
 	struct sshkey *private = NULL, *public = NULL;
 	struct passwd *pw;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list