From f84c32a341b61d66fe062a5816ff5041d134635e Mon Sep 17 00:00:00 2001 From: n-bes Date: Tue, 24 Sep 2024 19:21:36 +0300 Subject: [PATCH] fix: remove null terminator --- src/ngx_http_lua_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ngx_http_lua_misc.c b/src/ngx_http_lua_misc.c index 2fed53f7ad..8b74167161 100644 --- a/src/ngx_http_lua_misc.c +++ b/src/ngx_http_lua_misc.c @@ -103,7 +103,7 @@ ngx_http_lua_ffi_set_resp_status_and_reason(ngx_http_request_t *r, int status, ngx_str_set(&r->headers_out.status_line, "101 Switching Protocols"); } else if (reason != NULL && reason_len > 0) { - reason_len += 5; /* "ddd \0" */ + reason_len += 4; /* "ddd " */ buf = ngx_palloc(r->pool, reason_len); if (buf == NULL) { ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "no memory");