Skip to content

Commit 1d4c76d

Browse files
committed
bugfix: we did not declare the "level" local variable of ngx_http_lua_ngx_log at the beginning of the code block. thanks Edwin Cleton for the report.
1 parent db35efd commit 1d4c76d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ngx_http_lua_log.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ ngx_http_lua_ngx_log(lua_State *L)
3535
ngx_log_t *log;
3636
ngx_http_request_t *r;
3737
const char *msg;
38+
int level;
3839

3940
r = ngx_http_lua_get_req(L);
4041

@@ -45,7 +46,7 @@ ngx_http_lua_ngx_log(lua_State *L)
4546
log = ngx_cycle->log;
4647
}
4748

48-
int level = luaL_checkint(L, 1);
49+
level = luaL_checkint(L, 1);
4950
if (level < NGX_LOG_STDERR || level > NGX_LOG_DEBUG) {
5051
msg = lua_pushfstring(L, "bad log level: %d", level);
5152
return luaL_argerror(L, 1, msg);

0 commit comments

Comments
 (0)