Mercurial > hg > nginx
comparison src/http/modules/ngx_http_dav_module.c @ 4918:e7467ae41626
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Wed, 21 Nov 2012 00:51:37 +0000 |
parents | d620f497c50f |
children | 11599a3d0c7c |
comparison
equal
deleted
inserted
replaced
4917:484aec758d2c | 4918:e7467ae41626 |
---|---|
207 ngx_uint_t status; | 207 ngx_uint_t status; |
208 ngx_file_info_t fi; | 208 ngx_file_info_t fi; |
209 ngx_ext_rename_file_t ext; | 209 ngx_ext_rename_file_t ext; |
210 ngx_http_dav_loc_conf_t *dlcf; | 210 ngx_http_dav_loc_conf_t *dlcf; |
211 | 211 |
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 | |
212 ngx_http_map_uri_to_path(r, &path, &root, 0); | 217 ngx_http_map_uri_to_path(r, &path, &root, 0); |
213 | 218 |
214 path.len--; | 219 path.len--; |
215 | 220 |
216 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 221 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |