]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream commit
authordjm@openbsd.org <djm@openbsd.org>
Sun, 28 Aug 2016 22:28:12 +0000 (22:28 +0000)
committerDamien Miller <djm@mindrot.org>
Mon, 29 Aug 2016 01:20:45 +0000 (11:20 +1000)
fix uninitialised optlen in getsockopt() call; harmless
on Unix/BSD but potentially crashy on Cygwin. Reported by James Slepicka ok
deraadt@

Upstream-ID: 1987ccee508ba5b18f016c85100d7ac3f70ff965

sshd.c

diff --git a/sshd.c b/sshd.c
index a561c7b3eade62c1d0067482bce66d217d3918ec..6d182239b58cb99fb53d2789d406d8d264c853b2 100644 (file)
--- a/sshd.c
+++ b/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 <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1313,8 +1313,8 @@ check_ip_options(struct ssh *ssh)
 #ifdef IP_OPTIONS
        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));