Skip to content

Commit 7585bf9

Browse files
author
Petr Vaganov
committed
fixes: add assert for ngx_stream_lua_get_req in ngx_stream_lua_sema_timeout_handler
DEREF_OF_NULL.RET.STAT Return value of a function 'ngx_stream_lua_get_req' is dereferenced at ngx_stream_lua_semaphore.c:537 without checking for NULL, but it is usually checked for this function (35/41). Found by Linux Verification Center with Svace. Signed-off-by: Petr Vaganov <petrvaganoff@gmail.com>
1 parent 11f9e38 commit 7585bf9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/ngx_stream_lua_semaphore.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,7 @@ ngx_stream_lua_sema_timeout_handler(ngx_event_t *ev)
534534
sem->wait_count--;
535535

536536
r = ngx_stream_lua_get_req(wait_co_ctx->co);
537+
ngx_stream_lua_assert(r != NULL);
537538

538539
ctx = ngx_stream_lua_get_module_ctx(r, ngx_stream_lua_module);
539540
ngx_stream_lua_assert(ctx != NULL);

0 commit comments

Comments
 (0)