mirror of
https://github.com/nginx/nginx.git
synced 2024-11-24 13:49:05 +08:00
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.
This commit is contained in:
parent
c5bee22d16
commit
90df702bf8
@ -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);
|
etag->value.data = ngx_pnalloc(r->pool, NGX_OFF_T_LEN + NGX_TIME_T_LEN + 3);
|
||||||
if (etag->value.data == NULL) {
|
if (etag->value.data == NULL) {
|
||||||
|
etag->hash = 0;
|
||||||
return NGX_ERROR;
|
return NGX_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user