httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: cookie death in 1.1b0
Date Sun, 18 Feb 1996 20:51:14 GMT
> 
> 
> Anyone make sense of this......
> 
> 
> (gdb) where
> #0  0xef7939a0 in kill ()
> #1  0xef7abc2c in abort ()
> #2  0x4d70 in seg_fault () at http_main.c:657
> #3  0xef76acdc in _sigtramp ()
> #4  0xef76d680 in _doprnt ()
> #5  0xef76f67c in fprintf ()
> #6  0xebec in send_http_header (r=0x3d180) at http_protocol.c:568
> #7  0x8860 in default_handler (r=0x3d180) at http_core.c:715
> #8  0x9304 in invoke_handler (r=0x3d180) at http_config.c:310
> #9  0xc3a4 in process_request_internal (r=0x3d180) at http_request.c:662
> #10 0xc3e4 in process_request (r=0x3d180) at http_request.c:668
> #11 0x56c4 in child_main (child_num_arg=10) at http_main.c:905
> #12 0x58d8 in make_child (server_conf=0x337a8, child_num=10) at http_main.c:942
> #13 0x5f94 in standalone_main (argc=2, argv=0xeffffaec) at http_main.c:1062
> #14 0x6238 in main (argc=2, argv=0xeffffaec) at http_main.c:1114
> 
> 
> Seems to come from
>           fprintf (fd, "%s: %s\015\012", hdrs[i].key, hdrs[i].val);
> [http_protocol.c:568]
> 
> This happens when I switch on the cookie module.
> 
> In http_protocol.c we have....
> 
>     for (i = 0; i < hdrs_arr->nelts; ++i) {
>         if (!hdrs[i].key) continue;
>         fprintf (fd, "%s: %s\015\012", hdrs[i].key, hdrs[i].val);
>     }
> 
>     for (i = 0; i < err_hdrs_arr->nelts; ++i) {
>         if (!err_hdrs[i].key) continue;
>         fprintf (fd, "%s: %s\015\012", err_hdrs[i].key, err_hdrs[i].val);
>     }
> 
> -=-=-=-=
> 
> Maybe the "if"s need to be replaced with
> 
>    if (!hdrs[i].key || !!hdrs[i].val) continue;
> and
>    if (!err_hdrs[i].key || !err_hdrs[i].val) continue;

It strikes me as odd that the key should have any possibility of being NULL.
Perhaps the author meant to test the val instead?

i.e.
	assert(hdrs[i].key);
	if(!hdrs[i].val)
		continue;

Cheers,

Ben.

> 
> 
> Just to be safe?
> 
> 
> 
> rob

-- 
Ben Laurie                  Phone: +44 (181) 994 6435
Freelance Consultant and    Fax:   +44 (181) 994 6472
Technical Director          Email: ben@algroup.co.uk
A.L. Digital Ltd,           URL: http://www.algroup.co.uk
London, England.

Mime
View raw message