Marc Slemko wrote:
>
> On Sat, 8 Feb 1997, Ben Laurie wrote:
>
> > > * core dump in sub_req_lookup_file() if invalid directive in .htaccess
> > > PR#162
> > >
> >
> > PR#162 includes a patch. +1 for that patch.
>
> I'm not sure I'm comfortable with the possible side-effects of that
> change. I have seen several cases of a similar thing happening, and would
> suggest something like the below change. It is arguable that the change
> suggested in PR#162 should be made anyway, but I know enough about the
> code there to know that I do not know enough to be convinced there will be
> no bad side-effects from that patch.
>
> What this does is if it was passed a NULL dir_conf, it just assumes you
> want to do hostname lookups. It could be coded to assume that it
> shouldn't, not sure which is best.
I can't see how there can be any problem setting the configuration to the
default early - every path through that code results in it being set to
something that is derived from the default anyway.
On the other hand, your patch (or something similar) would cure related
problems, so I'm in favour.
Cheers,
Ben.
>
> Index: http_core.c
> ===================================================================
> RCS file: /export/home/cvs/apache/src/http_core.c,v
> retrieving revision 1.64
> diff -c -r1.64 http_core.c
> *** http_core.c 1997/02/03 02:42:57 1.64
> --- http_core.c 1997/02/08 21:57:28
> ***************
> *** 313,321 ****
> core_dir_config *dir_conf;
>
> /* If we haven't checked the host name, and we want to */
> ! dir_conf = (core_dir_config *)get_module_config(dir_config, &core_module);
>
> ! if (type != REMOTE_NOLOOKUP && conn->remote_host == NULL && dir_conf->hostname_lookups)
> {
> #ifdef STATUS
> int old_stat = update_child_status(conn->child_num,
> --- 313,322 ----
> core_dir_config *dir_conf;
>
> /* If we haven't checked the host name, and we want to */
> ! if (dir_config)
> ! dir_conf = (core_dir_config *)get_module_config(dir_config, &core_module);
>
> ! if ((!dir_conf) || (type != REMOTE_NOLOOKUP && conn->remote_host == NULL
&& dir_conf->hostname_lookups))
> {
> #ifdef STATUS
> int old_stat = update_child_status(conn->child_num,
>
>
--
Ben Laurie Phone: +44 (181) 994 6435 Email: ben@algroup.co.uk
Freelance Consultant and Fax: +44 (181) 994 6472
Technical Director URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd, Apache Group member (http://www.apache.org)
London, England. Apache-SSL author
|