#1810 Uninitialized scalar variable in responder_get_domain
Closed: Fixed None Opened 7 years ago by jhrozek.

887struct sss_domain_info *
888responder_get_domain(TALLOC_CTX *sd_mem_ctx, struct resp_ctx *rctx,
889                     const char *name)
890{
891    time_t now = time(NULL);
CID 13137: Uninitialized scalar variable (UNINIT)Declaring variable "time_diff" without initializer.
892    time_t time_diff;
893    struct sss_domain_info *dom;
894    struct sss_domain_info *ret_dom = NULL;
895
At conditional (1): "dom" taking the true branch.
896    for (dom = rctx->domains; dom; dom = get_next_domain(dom, true)) {
At conditional (2): "!(dom->parent != NULL)" taking the false branch.
897        if (!IS_SUBDOMAIN(dom)) {
898            time_diff = now - dom->subdomains_last_checked.tv_sec;
899        }
At conditional (3): "strcasecmp(dom->name, name) == 0" taking the true branch.
900        if (strcasecmp(dom->name, name) == 0 ||
901            (dom->flat_name != NULL &&
902             strcasecmp(dom->flat_name, name) == 0)) {
903            ret_dom = dom;
At conditional (4): "!(dom->parent != NULL)" taking the false branch.
At conditional (5): "dom->parent != NULL" taking the true branch.
Using uninitialized value "time_diff".
904            if (!IS_SUBDOMAIN(dom) ||
905                (IS_SUBDOMAIN(dom) && time_diff < rctx->domains_timeout)) {
906                break;
907            }
908        }
909
910    }

Coverity issue, doesn't need a clone

rhbz: => 0

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.10 beta
owner: somebody => okos
patch: 0 => 1

resolution: => fixed
status: new => closed

Metadata Update from @jhrozek:
- Issue assigned to okos
- Issue set to the milestone: SSSD 1.10 beta

3 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/2852

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata