#3880 re-order null check in ipa-lockout
Closed: Fixed None Opened 10 years ago by rcritten.

Coverity issue 11911:

244    if (ldrc == 0) {
245        Slapi_Value *sv = NULL;
246

deref_ptr: Directly dereferencing pointer "values".
247        slapi_valueset_first_value(*values, &sv);
248

CID 11911 (#1 of 1): Dereference before null check (REVERSE_INULL)check_after_deref: 
Null-checking "values" suggests that it may be null, but it has already been 
dereferenced on all paths leading to the check.
249        if (values != NULL) {
250            *policy_dn = slapi_value_get_string(sv);
251        }
252    }

There is no risk of crash here as slapi_valueset_first_value() can handle the case where the valueset is NULL, but there is no point in calling that if we know there are no values.


Metadata Update from @rcritten:
- Issue assigned to rcritten
- Issue set to the milestone: FreeIPA 3.3.x - 2013/08 (bug fixing)

7 years ago

Login to comment on this ticket.

Metadata