Skip to content

Commit ce8405c

Browse files
authored
bugfix: ngx.run_worker_thread injected api into the wrong table.(openresty#1996)
1 parent fa5982c commit ce8405c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ngx_http_lua_worker_thread.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,13 @@ ngx_http_lua_get_task_ctx(lua_State *L, ngx_http_request_t *r)
139139
lua_setfield(vm, -2, "path");
140140
lua_pushlstring(vm, cpath, cpath_len);
141141
lua_setfield(vm, -2, "cpath");
142+
lua_pop(vm, 1);
142143

143144
/* pop path, cpath and "package" table from L */
144145
lua_pop(L, 3);
145146

146147
/* inject API from C */
147-
lua_newtable(L); /* ngx.* */
148+
lua_newtable(vm); /* ngx.* */
148149
ngx_http_lua_inject_string_api(vm);
149150
ngx_http_lua_inject_config_api(vm);
150151
lua_setglobal(vm, "ngx");

0 commit comments

Comments
 (0)