Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10078

Coverity, derefere null return value in KeyStoreCredentialStore.store

XMLWordPrintable

      Coverity found possible null dereference as getEntry() could return null.

      https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=12563831&defectInstanceId=2991455&mergedDefectId=1422740

      KeyStoreCredentialStore.java
              void store(OutputStream outputStream) throws IOException, GeneralSecurityException {
                  ObjectOutputStream oos = new ObjectOutputStream(outputStream);
                  oos.writeInt(VERSION);
                  Enumeration<String> ksAliases = dataKeyStore.aliases();
                  while(ksAliases.hasMoreElements()) {
                      String alias = ksAliases.nextElement();
                      KeyStore.Entry entry = dataKeyStore.getEntry(alias, convertParameter(protectionParameter));
                      if (entry instanceof KeyStore.SecretKeyEntry) {
                          saveSecretKey(alias, oos, (KeyStore.SecretKeyEntry)entry);
                      } else {
                          throw log.unrecognizedEntryType(entry.getClass().getCanonicalName());
                      }
                  }
                  oos.flush();
                  oos.close();
              }
      

              rhn-support-ivassile Ilia Vassilev
              mchoma@redhat.com Martin Choma
              Martin Choma Martin Choma
              Martin Choma Martin Choma
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: