diff options
author | Piotr Sikora <piotr@aviatrix.com> | 2024-02-26 20:00:28 +0000 |
---|---|---|
committer | Piotr Sikora <piotr@aviatrix.com> | 2024-02-26 20:00:28 +0000 |
commit | 2f9e8431e696b27ffcd69e455a1ee006ca14f8e3 (patch) | |
tree | b3ad8bb3152f5bcd6ebdd26550bacf22713926e7 /src | |
parent | 3d5a356abb4f06b0f103290bd31a4c146233956b (diff) | |
download | nginx-2f9e8431e696b27ffcd69e455a1ee006ca14f8e3.tar.gz nginx-2f9e8431e696b27ffcd69e455a1ee006ca14f8e3.zip |
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 (limited to 'src')
-rw-r--r-- | src/http/modules/ngx_http_rewrite_module.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_rewrite_module.c b/src/http/modules/ngx_http_rewrite_module.c index 0e6d4df64..ff3b68716 100644 --- a/src/http/modules/ngx_http_rewrite_module.c +++ b/src/http/modules/ngx_http_rewrite_module.c @@ -489,6 +489,7 @@ ngx_http_rewrite_return(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) } if (cf->args->nelts == 2) { + ngx_str_set(&ret->text.value, ""); return NGX_CONF_OK; } |