aboutsummaryrefslogtreecommitdiffstats
path: root/main/lighttpd/0012-network-fix-compile-break-in-calculation-of-sockaddr.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-07-07 14:20:33 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2015-07-07 14:20:33 +0000
commitc1ee7a6e6d21447788c7512e7197d49ebfbc3096 (patch)
treef6dbf52c47e29ab57edc25ed499f7c6f4745ef75 /main/lighttpd/0012-network-fix-compile-break-in-calculation-of-sockaddr.patch
parent77345a923c72d9e8d0a4202d893239ba43b903a3 (diff)
downloadaports-c1ee7a6e6d21447788c7512e7197d49ebfbc3096.tar.bz2
aports-c1ee7a6e6d21447788c7512e7197d49ebfbc3096.tar.xz
main/lighttpd: security fix for CVE-2015-3200
The upstream patch does not apply without applying lot other stuff so we simply apply all since 1.4.35 release. ref #4329
Diffstat (limited to 'main/lighttpd/0012-network-fix-compile-break-in-calculation-of-sockaddr.patch')
-rw-r--r--main/lighttpd/0012-network-fix-compile-break-in-calculation-of-sockaddr.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/main/lighttpd/0012-network-fix-compile-break-in-calculation-of-sockaddr.patch b/main/lighttpd/0012-network-fix-compile-break-in-calculation-of-sockaddr.patch
new file mode 100644
index 0000000000..9aa38e537d
--- /dev/null
+++ b/main/lighttpd/0012-network-fix-compile-break-in-calculation-of-sockaddr.patch
@@ -0,0 +1,66 @@
+From b0a632f253737463138c182a3fb9c8be04caef5d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Stefan=20B=C3=BChler?= <stbuehler@web.de>
+Date: Sat, 7 Feb 2015 11:33:30 +0000
+Subject: [PATCH 12/29] [network] fix compile break in calculation of
+ sockaddr_un size if SUN_LEN is not defined (fixes #2609)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Stefan Bühler <stbuehler@web.de>
+
+git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2972 152afb58-edef-0310-8abb-c4023f1b3aa9
+---
+ NEWS | 1 +
+ src/network.c | 13 +++++++------
+ 2 files changed, 8 insertions(+), 6 deletions(-)
+
+diff --git a/NEWS b/NEWS
+index 7347012..bf8984f 100644
+--- a/NEWS
++++ b/NEWS
+@@ -12,6 +12,7 @@ NEWS
+ * [mod_dirlisting,mod_redirect,mod_rewrite] abort config parsing if pcre-compile fails or isn't available
+ * [ssl] disable SSL3.0 by default
+ * fixed typo in example config found by openSUSE user (boo# 907709)
++ * [network] fix compile break in calculation of sockaddr_un size if SUN_LEN is not defined (fixes #2609)
+
+ - 1.4.35 - 2014-03-12
+ * [network/ssl] fix build error if TLSEXT is disabled
+diff --git a/src/network.c b/src/network.c
+index ebde43b..776a86c 100644
+--- a/src/network.c
++++ b/src/network.c
+@@ -349,6 +349,8 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
+
+ break;
+ case AF_UNIX:
++ memset(&srv_socket->addr, 0, sizeof(struct sockaddr_un));
++ srv_socket->addr.un.sun_family = AF_UNIX;
+ {
+ size_t hostlen = strlen(host) + 1;
+ if (hostlen > sizeof(srv_socket->addr.un.sun_path)) {
+@@ -356,15 +358,14 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
+ goto error_free_socket;
+ }
+ memcpy(srv_socket->addr.un.sun_path, host, hostlen);
+- }
+- srv_socket->addr.un.sun_family = AF_UNIX;
+
+-#ifdef SUN_LEN
+- addr_len = SUN_LEN(&srv_socket->addr.un);
++#if defined(SUN_LEN)
++ addr_len = SUN_LEN(&srv_socket->addr.un);
+ #else
+- /* stevens says: */
+- addr_len = hostlen + sizeof(srv_socket->addr.un.sun_family);
++ /* stevens says: */
++ addr_len = hostlen + sizeof(srv_socket->addr.un.sun_family);
+ #endif
++ }
+
+ /* check if the socket exists and try to connect to it. */
+ if (-1 != (fd = connect(srv_socket->fd, (struct sockaddr *) &(srv_socket->addr), addr_len))) {
+--
+2.4.5
+