#865 Uninitialized value error in sss_cache's invalidate_entry()
Closed: Fixed None Opened 12 years ago by sgallagh.

147errno_t invalidate_entry(TALLOC_CTX *ctx, struct sysdb_ctx *sysdb,
 148                         const char *name, int entry_type)
 149{
 150    struct sysdb_attrs *sys_attrs = NULL;
CID 10865: Uninitialized scalar variable (UNINIT)Declaring variable "ret" without initializer.
 151    errno_t ret;
 152
 153    sys_attrs = sysdb_new_attrs(ctx);
At conditional (1): "sys_attrs" taking the false branch.
 154    if (sys_attrs) {
 155        ret = sysdb_attrs_add_time_t(sys_attrs,
 156                SYSDB_CACHE_EXPIRE, 1);
 157        if (ret == EOK) {
 158            switch (entry_type) {
 159                case TYPE_USER:
 160                    ret = sysdb_set_user_attr(ctx, sysdb, NULL, name,
 161                            sys_attrs, SYSDB_MOD_REP);
 162                    break;
 163                case TYPE_GROUP:
 164                    ret = sysdb_set_group_attr(ctx, sysdb, NULL, name,
 165                            sys_attrs, SYSDB_MOD_REP);
 166                    break;
 167                case TYPE_NETGROUP:
 168                    ret = sysdb_set_netgroup_attr(sysdb, NULL, name,
 169                            sys_attrs, SYSDB_MOD_REP);
 170                    break;
 171                default:
 172                    return EINVAL;
 173            }
 174            if (ret != EOK) {
 175                DEBUG(3, ("Could not set entry attributes\n"));
 176            }
 177        } else {
 178            DEBUG(3, ("Could not add expiration time to attributes\n"));
 179        }
 180        talloc_zfree(sys_attrs);
 181    } else {
At conditional (2): "3 <= debug_level" taking the true branch.
At conditional (3): "debug_timestamps" taking the true branch.
 182        DEBUG(3, ("Could not create sysdb attributes\n"));
 183    }
Using uninitialized value "ret".
 184    return ret;
 185}

Fields changed

patch: 0 => 1
status: new => assigned

Fixed in: d35c831

resolution: => fixed
status: assigned => closed

Fields changed

rhbz: => 0

Metadata Update from @sgallagh:
- Issue assigned to jzeleny
- Issue set to the milestone: SSSD 1.6.0

7 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/1907

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