[jboss-jira] [JBoss JIRA] (WFLY-7830) Coverity: Logically dead code in PermissionMapperDefinitions (Elytron subsystem)

Darran Lofthouse (JIRA) issues at jboss.org
Thu Jan 12 13:51:00 EST 2017


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

Darran Lofthouse updated WFLY-7830:
-----------------------------------
    Fix Version/s: 11.0.0.Alpha1


> Coverity: Logically dead code in PermissionMapperDefinitions (Elytron subsystem)
> --------------------------------------------------------------------------------
>
>                 Key: WFLY-7830
>                 URL: https://issues.jboss.org/browse/WFLY-7830
>             Project: WildFly
>          Issue Type: Bug
>          Components: Security
>            Reporter: Josef Cacek
>            Assignee: Ilia Vassilev
>              Labels: static_analysis
>             Fix For: 11.0.0.Alpha1
>
>
> Coverity static-analysis scan found a logically dead code in the {{PermissionMapperDefinitions.getSimplePermissionMapper}} method.
> https://scan7.coverity.com/reports.htm#v16159/p12663/fileInstanceId=6892117&defectInstanceId=1794520&mergedDefectId=1388477
> https://scan7.coverity.com/reports.htm#v16159/p12663/fileInstanceId=6892117&defectInstanceId=1794521&mergedDefectId=1388478
> Following code
> {code:java}
> permissionMappings.add(new Mapping(principals != null ? principals : Collections.emptySet(),
>         roles != null ? roles : Collections.emptySet(), permissions));
> {code}
> should rather be
> {code:java}
> permissionMappings.add(new Mapping(principals, roles, permissions));
> {code}
> because both {{principals}} and {{roles}} local variables are initialized ({{new HashSet...}}) before this piece of code.



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


More information about the jboss-jira mailing list