From: Cyril Bonté Date: Wed, 24 Oct 2012 21:47:47 +0000 (+0200) Subject: BUG/MAJOR: fix a segfault on option http_proxy and url_ip acl X-Git-Tag: v1.5-dev13~122 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ccf6612256a1ea9ee23fb7926699672f2a6a83f;p=thirdparty%2Fhaproxy.git BUG/MAJOR: fix a segfault on option http_proxy and url_ip acl url2sa() mistakenly uses "addr" as a reference. This causes a segfault when option http_proxy or url_ip are used. This bug was introduced in haproxy 1.5 and doesn't need to be backported. --- diff --git a/src/standard.c b/src/standard.c index 287931adf3..76031e9562 100644 --- a/src/standard.c +++ b/src/standard.c @@ -906,12 +906,12 @@ int url2sa(const char *url, int ulen, struct sockaddr_storage *addr) * be warned this can slow down global daemon performances * while handling lagging dns responses. */ - ret = url2ipv4(curr, &((struct sockaddr_in *)&addr)->sin_addr); + ret = url2ipv4(curr, &((struct sockaddr_in *)addr)->sin_addr); if (!ret) return -1; curr += ret; ((struct sockaddr_in *)addr)->sin_port = (*curr == ':') ? str2uic(++curr) : 80; - ((struct sockaddr_in *)addr)->sin_port = htons(((struct sockaddr_in *)&addr)->sin_port); + ((struct sockaddr_in *)addr)->sin_port = htons(((struct sockaddr_in *)addr)->sin_port); } return 0; }