httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Takashi Sato <taka...@lans-tv.com>
Subject [patch] mod_autoindex stability depends on ap_field_noparam
Date Mon, 03 Nov 2008 13:40:42 GMT
find_default_item passes an imperfect request_rec to find_item.
find_item calls ap_field_noparam with uninitialized memory pool (r->pool).
Though this doesn't matter since ap_field_noparam simply returns NULL when
the 2nd argument is NULL, IMHO this should be fixed.
The attached patch makes find_default_item stop create reqest_rec.


static char *find_item(request_rec *r, apr_array_header_t *list, int path_only)
{
    const char *content_type = ap_field_noparam(r->pool, r->content_type);

[cut]

static char *find_default_item(char *bogus_name, apr_array_header_t *list)
{
    request_rec r;
    /* Bleah.  I tried to clean up find_item, and it lead to this bit
     * of ugliness.   Note that the fields initialized are precisely
     * those that find_item looks at...
     */
    r.filename = bogus_name;
    r.content_type = r.content_encoding = NULL;
    return find_item(&r, list, 1);
}

Mime
View raw message