[jboss-jira] [JBoss JIRA] (ELY-1195) Coverity, Dereference after null check in KeyStoreCredentialStore (Elytron)

Ilia Vassilev (JIRA) issues at jboss.org
Wed May 24 07:42:00 EDT 2017


     [ https://issues.jboss.org/browse/ELY-1195?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilia Vassilev reassigned ELY-1195:
----------------------------------

    Assignee: Ilia Vassilev  (was: Darran Lofthouse)


> Coverity, Dereference after null check in KeyStoreCredentialStore (Elytron)
> ---------------------------------------------------------------------------
>
>                 Key: ELY-1195
>                 URL: https://issues.jboss.org/browse/ELY-1195
>             Project: WildFly Elytron
>          Issue Type: Bug
>            Reporter: Martin Choma
>            Assignee: Ilia Vassilev
>            Priority: Critical
>
> dataLocation is dereferenced, although it is checked on null before (could be null). 
> Setting Critical priority as that can cover root cause of real problem with NPE.
> {code:java|title=KeyStoreCredentialStore.java}
> try {
>     if (dataLocation != null && Files.exists(dataLocation)) {
>         char[] password = getStorePassword(protectionParameter);
>         try (InputStream fileStream = Files.newInputStream(dataLocation)) {
>             if (useExternalStorage) {
>                 externalStorage.load(fileStream);
>             } else {
>                 keyStore.load(fileStream, password);
>             }
>         }
>         enumeration = keyStore.aliases();
>     } else {
>         keyStore.load(null, null);
>         enumeration = Collections.emptyEnumeration();
>     }
> } catch (GeneralSecurityException e) {
>     throw log.cannotInitializeCredentialStore(
>             log.internalEncryptionProblem(e, dataLocation.toString()));
> }
> {code}
> https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=20120757&defectInstanceId=4609349&mergedDefectId=1436246



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list