From 1a161c9d3f49880aeef3e388ce4e5ee5d4665fe8 Mon Sep 17 00:00:00 2001 From: Fahnenfluchtige Date: Thu, 10 Apr 2025 17:37:33 +0300 Subject: [PATCH] Fixing deref of null in ngx_stream_lua_util --- src/ngx_stream_lua_util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ngx_stream_lua_util.c b/src/ngx_stream_lua_util.c index 2bf96f8e..87a94a85 100644 --- a/src/ngx_stream_lua_util.c +++ b/src/ngx_stream_lua_util.c @@ -1935,6 +1935,10 @@ ngx_stream_lua_req_socket(lua_State *L) r = ngx_stream_lua_get_req(L); + if (r == NULL) { + return luaL_error(L, "no request found"); + } + ctx = ngx_stream_lua_get_module_ctx(r, ngx_stream_lua_module); if (ctx == NULL) { return luaL_error(L, "no ctx found");