Skip to content

fix potential null pointer dereference found by coverity #2051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2022

Conversation

chipitsine
Copy link
Contributor

    deref_ptr: Directly dereferencing pointer ctx.
1143    *ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);
    CID 258020 (#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking ctx suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1144    if (ctx == NULL) {
1145        return NGX_HTTP_LUA_FFI_NO_REQ_CTX;
1146    }

I hereby granted the copyright of the changes in this pull request
to the authors of this lua-nginx-module project.

    deref_ptr: Directly dereferencing pointer ctx.
1143    *ctx = ngx_http_get_module_ctx(r, ngx_http_lua_module);
    CID 258020 (openresty#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: Null-checking ctx suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
1144    if (ctx == NULL) {
1145        return NGX_HTTP_LUA_FFI_NO_REQ_CTX;
1146    }
@zhuizhuhaomeng zhuizhuhaomeng merged commit b91221b into openresty:master May 25, 2022
@chipitsine chipitsine deleted the coverity_1 branch May 25, 2022 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants