Aaron Bannert wrote: > Subject: > > Re: [PATCH] listen.c -- fix restart SEGV --please comment/commit > From: > > Aaron Bannert <[EMAIL PROTECTED]> > Date: > > Wed, 28 Nov 2001 13:28:33 -0800 > > To: > > [EMAIL PROTECTED]
> p.s. for some reason I can never cleanly apply patches that are sent > through your mailer. Is it somehow munging the tabs? Can someone enlighten > me on this? (I'm just doing `patch -p0 < ~/ian.segv.patch` and it rejects > the whole thing.) > > -aaron > I'ts the latest mozilla nightly build ;( but sometimes I use evolution .. the patch was cut/pasted from VNC so it could be that (I attached it this time)
Index: server/listen.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/listen.c,v retrieving revision 1.64 diff -u -r1.64 listen.c --- server/listen.c 2001/11/13 22:42:38 1.64 +++ server/listen.c 2001/11/28 21:19:05 @@ -237,16 +237,18 @@ /* see if we've got an old listener for this address:port */ for (walk = &old_listeners; *walk; walk = &(*walk)->next) { sa = (*walk)->bind_addr; - apr_sockaddr_port_get(&oldport, sa); - apr_sockaddr_ip_get(&oldaddr, sa); - if (!strcmp(oldaddr, addr) && port == oldport) { - /* re-use existing record */ - new = *walk; - *walk = new->next; - new->next = ap_listeners; - ap_listeners = new; - return; - } + if (sa) { + apr_sockaddr_port_get(&oldport, sa); + apr_sockaddr_ip_get(&oldaddr, sa); + if (!strcmp(oldaddr, addr) && port == oldport) { + /* re-use existing record */ + new = *walk; + *walk = new->next; + new->next = ap_listeners; + ap_listeners = new; + return; + } + } } /* this has to survive restarts */