Welcome! Log In Create A New Profile

Advanced

[nginx] Rewrite: fixed "return" directive without response text.

Sergey Kandaurov
March 27, 2024 01:48PM
details: https://hg.nginx.org/nginx/rev/dd4a570ff4ac
branches:
changeset: 9228:dd4a570ff4ac
user: Piotr Sikora <piotr@aviatrix.com>
date: Mon Feb 26 20:00:28 2024 +0000
description:
Rewrite: fixed "return" directive without response text.

Previously, the response text wasn't initialized and the rewrite module
was sending response body set to NULL.

Found with UndefinedBehaviorSanitizer (pointer-overflow).

Signed-off-by: Piotr Sikora <piotr@aviatrix.com>

diffstat:

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

diffs (11 lines):

diff -r f208413f307f -r dd4a570ff4ac src/http/modules/ngx_http_rewrite_module.c
--- a/src/http/modules/ngx_http_rewrite_module.c Mon Mar 18 17:14:30 2024 +0400
+++ b/src/http/modules/ngx_http_rewrite_module.c Mon Feb 26 20:00:28 2024 +0000
@@ -489,6 +489,7 @@ ngx_http_rewrite_return(ngx_conf_t *cf,
}

if (cf->args->nelts == 2) {
+ ngx_str_set(&ret->text.value, "");
return NGX_CONF_OK;
}

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

[nginx] Rewrite: fixed "return" directive without response text.

Sergey Kandaurov 234 March 27, 2024 01:48PM



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

Online Users

Guests: 154
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