DO NOT REPLY [Bug 47762] New: contextChild parameter of Transform.getInstance may be null

View: New views
2 Messages — Rating Filter:   Alert me  

DO NOT REPLY [Bug 47762] New: contextChild parameter of Transform.getInstance may be null

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47762

           Summary: contextChild parameter of Transform.getInstance may be
                    null
           Product: Security
           Version: Java 1.4.2
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: Signature
        AssignedTo: security-dev@...
        ReportedBy: julienpasquier@...


--- Comment #0 from Julien Pasquier <julienpasquier@...> 2009-08-28 11:16:37 PDT ---
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);
}

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

DO NOT REPLY [Bug 47762] contextChild parameter of Transform.getInstance may be null

by Bugzilla from bugzilla@apache.org :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

https://issues.apache.org/bugzilla/show_bug.cgi?id=47762


coheigea <coheigea@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from coheigea <coheigea@...> 2009-08-31 04:08:52 PDT ---
Fix applied.

Colm.

--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.