From: deraadt@openbsd.org Date: Fri, 21 Feb 2025 18:22:41 +0000 (+0000) Subject: upstream: Also prohibit , (comma) in hostnames, proposed by David X-Git-Tag: V_10_0_P1~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=487cf4c18c123b66c1f3f733398cd37e6b2ab6ab;p=thirdparty%2Fopenssh-portable.git upstream: Also prohibit , (comma) in hostnames, proposed by David Leadbeater ok djm millert OpenBSD-Commit-ID: 2837fa31dc6e81976f510f0a259edaa559b20b07 --- diff --git a/ssh.c b/ssh.c index d4e872c43..ff6249273 100644 --- a/ssh.c +++ b/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.604 2025/02/15 01:48:30 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.605 2025/02/21 18:22:41 deraadt Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -639,7 +639,7 @@ valid_hostname(const char *s) if (*s == '-') return 0; for (i = 0; s[i] != 0; i++) { - if (strchr("'`\"$\\;&<>|(){}", s[i]) != NULL || + if (strchr("'`\"$\\;&<>|(){},", s[i]) != NULL || isspace((u_char)s[i]) || iscntrl((u_char)s[i])) return 0; }