#520 Use of uninitialized string in validate_tgt()
Closed: Fixed Opened by sgallagh.

From Coverity:

  420static krb5_error_code validate_tgt(struct krb5_req *kr)
  421{
  422    krb5_error_code kerr;
  423    krb5_error_code kt_err;
Declaring variable "principal" without initializer.
  424    char *principal;
...
  461    /* Close the keytab here.  Even though we're using cursors, the file
  462     * handle is stored in the krb5_keytab structure, and it gets
  463     * overwritten when the verify_init_creds() call below creates its own
  464     * cursor, creating a leak. */
  465    kerr = krb5_kt_end_seq_get(kr->ctx, keytab, &cursor);
At conditional (7): "kerr != 0" taking the true branch.
  466    if (kerr != 0) {
At conditional (8): "1 <= debug_level" taking the true branch.
At conditional (9): "debug_timestamps" taking the true branch.
  467        DEBUG(1, ("krb5_kt_end_seq_get failed, not verifying TGT.\n"));
  468        goto done;
  469    }
...
Using uninitialized value "principal".
  505    if (principal != NULL) {
  506        sss_krb5_free_unparsed_name(kr->ctx, principal);
  507    }

If krb5_kt_end_seq_get() returns non-zero, there will be an unitialized value check in the 'done' label.


Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.2.1

Fixed by 340bef0ea2f1561881d811598f42564d125a2d5c

fixedin: => 1.2.1
keywords: => coverity
resolution: => fixed
status: new => closed

Fields changed

rhbz: => 0

Metadata Update from @sgallagh:
- Issue assigned to sbose
- Issue set to the milestone: SSSD 1.2.1

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

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.

Metadata