Changeset 4918:e7467ae41626 in nginx


Ignore:
Timestamp:
11/21/12 00:51:37 (4 years ago)
Author:
Maxim Dounin <mdounin@…>
Branch:
default
Convert:
svn:c3fe7df1-7212-e011-8a91-001109144009/trunk@4919
Message:

Dav: fixed segfault on PUT if body was already read (ticket #238).

If request body reading happens with different options it's possible
that there will be no r->request_body->temp_file available (or even
no r->request_body available if body was discarded). Return internal
server error in this case instead of committing suicide by dereferencing
a null pointer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/http/modules/ngx_http_dav_module.c

    r4412 r4918  
    210210    ngx_http_dav_loc_conf_t  *dlcf;
    211211
     212    if (r->request_body == NULL || r->request_body->temp_file == NULL) {
     213        ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
     214        return;
     215    }
     216
    212217    ngx_http_map_uri_to_path(r, &path, &root, 0);
    213218
Note: See TracChangeset for help on using the changeset viewer.