Santuario
  1. Santuario
  2. SANTUARIO-201

contextChild parameter of Transform.getInstance may be null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: Java 1.4.2
    • Fix Version/s: Java 1.4.4
    • Component/s: Java
    • Security Level: Public (Public issues, viewable by everyone)
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: PC

      Description

      The following method of the class org.apache.xml.security.transforms.Transform does not test if the contextChild parameter is null:
      public static final Transform getInstance(
      Document doc,
      String algorithmURI,
      Element contextChild)

      I propose this modified code to fix this bug:
      public static final Transform getInstance(
      Document doc, String algorithmURI, Element contextChild)
      throws InvalidTransformException {

      HelperNodeList contextNodes = null;

      if (contextChild != null)

      { contextNodes = new HelperNodeList(); XMLUtils.addReturnToElement(doc, contextNodes); contextNodes.appendChild(contextChild); XMLUtils.addReturnToElement(doc, contextNodes); }

      return Transform.getInstance(doc, algorithmURI, contextNodes);
      }

        Activity

        Hide
        Colm O hEigeartaigh added a comment -

        Fix applied.

        Colm.

        Show
        Colm O hEigeartaigh added a comment - Fix applied. Colm.

          People

          • Assignee:
            Unassigned
            Reporter:
            Julien Pasquier
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development