From: Cliff Woolley Date: Sun, 28 Sep 2003 16:30:43 +0000 (+0000) Subject: Setting lr = NULL on line 399 leads the the loop X-Git-Tag: pre_ajp_proxy~1136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=990368f445bf1fab035ca6c8d4468bb63b18ce76;p=apache Setting lr = NULL on line 399 leads the the loop closing early (see line 343) and the ap_listeners list being nonsense. End result is a segfault if something is already listening on :: on our port when httpd is started. Submitted by: Colm MacCarthaigh git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101338 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/listen.c b/server/listen.c index 778894e5a9..3b6c6d8ceb 100644 --- a/server/listen.c +++ b/server/listen.c @@ -395,8 +395,13 @@ static int ap_listen_open(apr_pool_t *pool, apr_port_t port) ap_listeners = lr->next; } - /* So that previous becomes NULL in the next iteration */ - lr = NULL; + /* Although we've removed ourselves from the list, + * we need to make sure that the next iteration won't + * consider "previous" a working IPv6 '::' socket. + * Changing the family is enough to make sure the + * conditions before make_sock() fail. + */ + lr->bind_addr->family = AF_INET; continue; }