Guaranteed NullPointerException depending on given QName in method
org.apache.xalan.extensions.XPathFunctionResolverImpl.resolveFunction
----------------------------------------------------------------------------------------------------------------------------------------
Key: XALANJ-2508
URL: https://issues.apache.org/jira/browse/XALANJ-2508
Project: XalanJ2
Issue Type: Bug
Security Level: No security risk; visible to anyone (Ordinary problems in
Xalan projects. Anybody can view the issue.)
Components: Xalan-extensions
Affects Versions: 2.7.1
Reporter: Jérôme Droz
Priority: Minor
If the method
org.apache.xalan.extensions.XPathFunctionResolverImpl.resolveFunction is called
with a QName argument having a namespaceURI not starting with
"http://exslt.org" or not equal to "http://xml.apache.org/xalan/java", the
method is guaranteed to throw a NullPointerException at line 61. It is the
case, for example, with a namespaceURI equal to "xalan://my-package.MyClass".
the following lines
61 int lastSlash = className.lastIndexOf("/");
62 if (-1 != lastSlash)
63 className = className.substring(lastSlash + 1);
should be changed to
61 int lastSlash = uri.lastIndexOf("/");
62 if (-1 != lastSlash)
63 className = uri.substring(lastSlash + 1);
in order to correctly interpret namespace declaration as "package format" or
"class format" as described in:
http://xml.apache.org/xalan-j/extensions.html#java-namespace
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]