Skip to content

Commit

Permalink
Rewrite: fixed "return" directive without response text.
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
PiotrSikora committed Feb 26, 2024
1 parent 3d5a356 commit 2f9e843
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/http/modules/ngx_http_rewrite_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2f9e843

Please sign in to comment.