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

Coverity, Dereference after null check (Elytron subsystem)

XMLWordPrintable

      Coverity found possible dereference of null. In this code defaultPolicy is checked for null (so probably could be null) and in next step defaultPolicy.equals() is called.

      https://scan7.coverity.com/reports.htm#v23632/p12663/fileInstanceId=10578397&defectInstanceId=2572005&mergedDefectId=1407435

      PolicyParser.java
              boolean providerFound = defaultPolicy == null;
      
              while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {
                  verifyNamespace(reader);
                  String localName = reader.getLocalName();
                  switch (localName) {
                      // Permission Mapper
                      case JACC_POLICY:
                          providerFound = defaultPolicy.equals(parseJaccPolicy(addPolicy, reader, operations)) || providerFound;
                          break;
                      case CUSTOM_POLICY:
                          providerFound = defaultPolicy.equals(parseCustomPolicy(addPolicy, reader, operations)) || providerFound;
                          break;
                      default:
                          throw unexpectedElement(reader);
                  }
              }
      

              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: