|
Mantis - Resin
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 2286 | major | always | 01-03-08 13:36 | 01-03-08 13:40 | |
|
|
|||||
| Reporter: | atifmk | Platform: | |||
| Assigned To: | ferg | OS: | |||
| Priority: | normal | OS Version: | |||
| Status: | closed | Product Version: | 3.1.3 | ||
| Product Build: | Resolution: | fixed | |||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 3.1.5 | ||
|
|
|||||
| Summary: | 0002286: NullPointerException in DomBuilder class | ||||
| Description: |
There is bug in com.caucho.xml.DomBuilder class that result in NPE at runtime while parsing the XML/XSL documents with namespaces. The bug is in the startPrefixMapping(String prefix, String url) method at line 178. If does a check for the empty prefix without considering that the prefix can be null. An example of this from the com.caucho.xsl.XslWriter class at line 1168: _xmlWriter.startPrefixMapping(null, topUrl); It's calling the startPrefixMapping(...) method with null prefix and results in NPE. The bug in DomBuilder class can very easily be fixed by following implemention of the method: public void startPrefixMapping(String prefix, String url) { if (_node == null || _node == _top) _doc.addNamespace(prefix, url); if (prefix == null || prefix.equals("")) { _prefixNames.add(new QName(null, "xmlns", XmlParser.XMLNS)); _prefixValues.add(url); } else { _prefixNames.add(new QName("xmlns", prefix, XmlParser.XMLNS)); _prefixValues.add(url); } } It does a check for null before doing a check for empty string. I am also attaching the DomBuilder.java with above changes in it. |
||||
| Steps To Reproduce: | |||||
| Additional Information: | |||||
| Relationships | |||||
| Attached Files: |
|
||||
| There are no notes attached to this issue. |