Welcome! Log In Create A New Profile

Advanced

[nginx] Fixed ETag memory allocation error handling.

Maxim Dounin
September 08, 2014 04:30PM
details: http://hg.nginx.org/nginx/rev/51fe42cc7876
branches:
changeset: 5825:51fe42cc7876
user: Maxim Dounin <mdounin@mdounin.ru>
date: Mon Sep 08 21:36:03 2014 +0400
description:
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:

src/http/ngx_http_core_module.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diffs (11 lines):

diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
--- 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;
}


_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed ETag memory allocation error handling.

Maxim Dounin 472 September 08, 2014 04:30PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 141
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready