]
Ilia Vassilev reassigned ELY-1051:
----------------------------------
Assignee: Ilia Vassilev (was: Darran Lofthouse)
Coverity, derefere null return value in
KeyStoreCredentialStore.store
---------------------------------------------------------------------
Key: ELY-1051
URL:
https://issues.jboss.org/browse/ELY-1051
Project: WildFly Elytron
Issue Type: Bug
Reporter: Martin Choma
Assignee: Ilia Vassilev
Priority: Critical
Coverity found possible null dereference as {{getEntry()}} could return null.
https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=12563...
{code:java|title=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();
}
{code}