[openssh-commits] [openssh] 04/06: check sockaddr length; GHPR681 from metsw24-max

git+noreply at mindrot.org git+noreply at mindrot.org
Mon Jun 29 17:52:20 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 fceb78d14abc710f2bab31f28d321a9bb2476781
Author: Damien Miller <djm at mindrot.org>
AuthorDate: Mon Jun 29 17:18:58 2026 +1000

    check sockaddr length; GHPR681 from metsw24-max
    
    ok dtucker
---
 openbsd-compat/fake-rfc2553.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c
index 5eaa47992..5197c3b37 100644
--- a/openbsd-compat/fake-rfc2553.c
+++ b/openbsd-compat/fake-rfc2553.c
@@ -51,7 +51,8 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
 	struct hostent *hp;
 	char tmpserv[16];
 
-	if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET)
+	if (sa->sa_family != AF_UNSPEC && sa->sa_family != AF_INET ||
+	    salen < sizeof(struct sockaddr_in))
 		return (EAI_FAMILY);
 	if (serv != NULL) {
 		snprintf(tmpserv, sizeof(tmpserv), "%d", ntohs(sin->sin_port));

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


More information about the openssh-commits mailing list