aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2014-09-08 21:36:03 +0400
committerMaxim Dounin <mdounin@mdounin.ru>2014-09-08 21:36:03 +0400
commit90df702bf86e4d9a9a2f319743598bc7aa1f8f57 (patch)
tree20104d9186d929be93ce43240559241efdd429fc /src
parentc5bee22d167486537ed9f36941dc4e0abdef1fce (diff)
downloadnginx-90df702bf86e4d9a9a2f319743598bc7aa1f8f57.tar.gz
nginx-90df702bf86e4d9a9a2f319743598bc7aa1f8f57.zip
Fixed ETag memory allocation error handling.
The etag->hash must be set to 0 to avoid an empty ETag header being returned with the 500 Internal Server Error page after the memory allocation failure. Reported by Markus Linnala.
Diffstat (limited to 'src')
-rw-r--r--src/http/ngx_http_core_module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 4071b6126..3b36f4a19 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1837,6 +1837,7 @@ ngx_http_set_etag(ngx_http_request_t *r)
etag->value.data = ngx_pnalloc(r->pool, NGX_OFF_T_LEN + NGX_TIME_T_LEN + 3);
if (etag->value.data == NULL) {
+ etag->hash = 0;
return NGX_ERROR;
}