Welcome! Log In Create A New Profile

Advanced

[PATCH] Rewrite: fix "return" directive without response text

Piotr Sikora via nginx-devel
February 27, 2024 08:24PM
# HG changeset patch
# User Piotr Sikora <piotr@aviatrix.com>
# Date 1708977628 0
# Mon Feb 26 20:00:28 2024 +0000
# Branch patch008
# Node ID 3cde11b747c08c69889edc014a700317fe4d1d88
# Parent 5584232259d28489efba149f2f5ae730691ff0d4
Rewrite: fix "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>

diff -r 5584232259d2 -r 3cde11b747c0 src/http/modules/ngx_http_rewrite_module.c
--- a/src/http/modules/ngx_http_rewrite_module.c Mon Feb 26 20:00:26 2024 +0000
+++ b/src/http/modules/ngx_http_rewrite_module.c Mon Feb 26 20:00:28 2024 +0000
@@ -489,6 +489,7 @@
}

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

[PATCH] Rewrite: fix "return" directive without response text

Piotr Sikora via nginx-devel 219 February 27, 2024 08:24PM

Re: [PATCH] Rewrite: fix "return" directive without response text

Sergey Kandaurov 25 March 27, 2024 01:52PM



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

Online Users

Guests: 246
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready