mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
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.
This commit is contained in:
parent
4c01beb64b
commit
9ccf661225
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue