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: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Julien Pasquier <[email protected]> 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.