From 990368f445bf1fab035ca6c8d4468bb63b18ce76 Mon Sep 17 00:00:00 2001 From: Cliff Woolley Date: Sun, 28 Sep 2003 16:30:43 +0000 Subject: [PATCH] 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 --- server/listen.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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; } -- 2.50.1