URL:
https://github.com/SSSD/sssd/pull/34
Title: #34: cache_req: move from switch to plugins
jhrozek commented:
"""
Well, it's still a lot of code :) but at least I started the review now. For starters,
Coverity found some warnings:
```
Error: FORWARD_NULL (CWE-476):
sssd-1.14.2/src/responder/common/cache_req/cache_req_search.c:104: var_compare_op:
Comparing "*_result" to null implies that "*_result" might be null.
sssd-1.14.2/src/responder/common/cache_req/cache_req_search.c:114: var_deref_op:
Dereferencing null pointer "*_result".
# 112| cr->debugobj, ret, sss_strerror(ret));
# 113| return ret;
# 114|-> } else if (cr->plugin->only_one_result &&
(*_result)->count > 1) {
# 115| CACHE_REQ_DEBUG(SSSDBG_CRIT_FAILURE, cr,
# 116| "Multiple objects were found when "
Error: UNINIT (CWE-457):
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c:34:
var_decl: Declaring variable "tmp_ctx" without initializer.
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_group_by_filter.c:68:
uninit_use_in_call: Using uninitialized value "tmp_ctx" when calling
"_talloc_free".
# 66|
# 67| done:
# 68|-> talloc_free(tmp_ctx);
# 69| return ret;
# 70| }
Error: UNINIT (CWE-457):
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_group_by_name.c:34: var_decl:
Declaring variable "tmp_ctx" without initializer.
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_group_by_name.c:74:
uninit_use_in_call: Using uninitialized value "tmp_ctx" when calling
"_talloc_free".
# 72|
# 73| done:
# 74|-> talloc_free(tmp_ctx);
# 75| return ret;
# 76| }
Error: UNINIT (CWE-457):
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c:34:
var_decl: Declaring variable "tmp_ctx" without initializer.
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_initgroups_by_name.c:74:
uninit_use_in_call: Using uninitialized value "tmp_ctx" when calling
"_talloc_free".
# 72|
# 73| done:
# 74|-> talloc_free(tmp_ctx);
# 75| return ret;
# 76| }
Error: UNINIT (CWE-457):
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c:34:
var_decl: Declaring variable "tmp_ctx" without initializer.
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_user_by_filter.c:68:
uninit_use_in_call: Using uninitialized value "tmp_ctx" when calling
"_talloc_free".
# 66|
# 67| done:
# 68|-> talloc_free(tmp_ctx);
# 69| return ret;
# 70| }
Error: UNINIT (CWE-457):
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_user_by_name.c:34: var_decl:
Declaring variable "tmp_ctx" without initializer.
sssd-1.14.2/src/responder/common/cache_req/plugins/cache_req_user_by_name.c:74:
uninit_use_in_call: Using uninitialized value "tmp_ctx" when calling
"_talloc_free".
# 72|
# 73| done:
# 74|-> talloc_free(tmp_ctx);
# 75| return ret;
# 76| }
```
"""
See the full comment at
https://github.com/SSSD/sssd/pull/34#issuecomment-252864641