From 2301d0d9f08af050f6cb02eaf591ea5a9a71d8ed Mon Sep 17 00:00:00 2001 From: djm Date: Sun, 28 Aug 2016 22:28:12 +0000 Subject: [PATCH] fix uninitialised optlen in getsockopt() call; harmless on Unix/BSD but potentially crashy on Cygwin. Reported by James Slepicka ok deraadt@ --- usr.bin/ssh/sshd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 2a2d149ad02..a6429c8eec3 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sshd.c,v 1.474 2016/08/19 03:18:07 djm Exp $ */ +/* $OpenBSD: sshd.c,v 1.475 2016/08/28 22:28:12 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -1243,8 +1243,8 @@ check_ip_options(struct ssh *ssh) { int sock_in = ssh_packet_get_connection_in(ssh); struct sockaddr_storage from; - socklen_t option_size, i, fromlen = sizeof(from); u_char opts[200]; + socklen_t i, option_size = sizeof(opts), fromlen = sizeof(from); char text[sizeof(opts) * 3 + 1]; memset(&from, 0, sizeof(from)); -- 2.20.1