You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, static checker svacer found several places where we are not checking req object for NULL, while it provided counter-examples where we are doing so.
And it seems, that we don't need to check result of the ngx_http_lua_get_req() as it just returns global object, which is http request object and it must be always available in context of the Lua code execution, because Lua code is always executed inside http request processing pipeline.
Is it right? Can you please confirm that it is false positive static analyzer case ?
If not, I can provide boring MR with trivial fixes.
Thanks!
The text was updated successfully, but these errors were encountered:
Hello, static checker svacer found several places where we are not checking req object for NULL, while it provided counter-examples where we are doing so.
Problematic files:
lua-nginx-module/src/ngx_http_lua_socket_tcp.c
Lines 5077 to 5083 in 5bd471a
lua-nginx-module/src/ngx_http_lua_semaphore.c
Lines 486 to 488 in 5bd471a
lua-nginx-module/src/ngx_http_lua_semaphore.c
Lines 530 to 532 in 5bd471a
lua-nginx-module/src/ngx_http_lua_output.c
Lines 490 to 496 in 5bd471a
We have other places where we do proper checks
lua-nginx-module/src/ngx_http_lua_socket_tcp.c
Lines 4521 to 4525 in 5bd471a
and 4 more cases in ngx_http_lua_socket_tcp.c, plus one case in ngx_http_lua_util.c:
lua-nginx-module/src/ngx_http_lua_util.c
Lines 3125 to 3129 in 5bd471a
definition of ngx_http_lua_get_req() follows:
And it seems, that we don't need to check result of the ngx_http_lua_get_req() as it just returns global object, which is http request object and it must be always available in context of the Lua code execution, because Lua code is always executed inside http request processing pipeline.
Is it right? Can you please confirm that it is false positive static analyzer case ?
If not, I can provide boring MR with trivial fixes.
Thanks!
The text was updated successfully, but these errors were encountered: