Uploaded image for project: 'Santuario'
  1. Santuario
  2. SANTUARIO-368

NullPointerException in XMLSecurity.java

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Java 1.4.8, Java 1.5.5
    • Fix Version/s: Java 1.5.6
    • Component/s: Java
    • Labels:
      None

      Description

      NullPointerException in XMLSecurity cconstructor if keyInfoElem does not contain a namespace:

      This code in the XMLSignature constructor:

      // If it exists use it, but it's not mandatory
      if (keyInfoElem != null
      && keyInfoElem.getNamespaceURI().equals(Constants.SignatureSpecNS)
      && keyInfoElem.getLocalName().equals(Constants._TAG_KEYINFO))

      { this.keyInfo = new KeyInfo(keyInfoElem, baseURI); this.keyInfo.setSecureValidation(secureValidation); }

      should be done like this:

      // If it exists use it, but it's not mandatory
      if (keyInfoElem != null
      && Constants.SignatureSpecNS.equals(keyInfoElem.getNamespaceURI())
      && Constants._TAG_KEYINFO.equals(keyInfoElem.getLocalName())) { this.keyInfo = new KeyInfo(keyInfoElem, baseURI); this.keyInfo.setSecureValidation(secureValidation); }

      to prevent NullPointerExceptions if either the namespaceURI or localName member elements happen to be null.

        Attachments

          Activity

            People

            • Assignee:
              coheigea Colm O hEigeartaigh
              Reporter:
              rwdennis Wally Dennis
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: