From: Maxim Dounin Date: Mon, 8 Sep 2014 17:36:03 +0000 (+0400) Subject: Fixed ETag memory allocation error handling. X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=90df702bf86e4d9a9a2f319743598bc7aa1f8f57;p=nginx.git 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. --- 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; }