Uploaded image for project: 'WildFly Elytron'
  1. WildFly Elytron
  2. ELY-832

Coverity static analysis: Dereference null return value in CredentialStoreCredentialSource (Elytron)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • None
    • None
    • None

      Coverity static-analysis scan found possible method call on null object in {{CredentialStoreCredentialSource.​getCredential(​)}}

      https://scan7.coverity.com/reports.htm#v16159/p11778/fileInstanceId=6803729&defectInstanceId=1776827&mergedDefectId=1388281&eventId=1776827-8
      The problematic piece of code is:

      credential = credentialStore.retrieve(alias, credentialType);
      return credential.castAs(credentialType, algorithmName, parameterSpec);
      

      The retrieve() method may return null in some cases as can be seen in KeyStoreCredentialStore class:

      //...
      final TopEntry topEntry = cache.get(credentialAlias);
      if (topEntry == null) {
          return null;
      }
      //...
      

              rhn-support-ivassile Ilia Vassilev
              josef.cacek@gmail.com Josef Cacek (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: