[
https://issues.apache.org/jira/browse/XERCESJ-1548?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Glavassevich resolved XERCESJ-1548.
-------------------------------------------
Resolution: Invalid
In practice the XMLLocator is never null. That code block is also unreachable,
guarded by a boolean that is always false.
> An incomplete fix for the NPE bugs in AbstractDOMParser.java
> ------------------------------------------------------------
>
> Key: XERCESJ-1548
> URL: https://issues.apache.org/jira/browse/XERCESJ-1548
> Project: Xerces2-J
> Issue Type: Bug
> Components: Other
> Reporter: Guangtai Liang
> Priority: Critical
> Labels: incomplete_fix, missing_fixes
> Original Estimate: 10m
> Remaining Estimate: 10m
>
> The fix revision 318567 was aimed to remove an NPE bug on the "locator" in
> the method "startDTD" of the file
> "/xerces/java/trunk/src/org/apache/xerces/parsers/AbstractDOMParser.java" ,
> but it is incomplete.
> Since the "locator" could be null during the run-time execution, it should
> also be null-checked before being dereferenced at Line 1683 and Line 1684.
> The buggy code the proposed missing fixes should be made in is as bellowing:
> public void startDTD(XMLLocator locator, Augmentations augs) throws
> XNIException {
> if (DEBUG_EVENTS) {
> System.out.println("==>startDTD");
> if (DEBUG_BASEURI) {
> System.out.println(" expandedSystemId:
> "+locator.getExpandedSystemId()); [Line 1683]
> System.out.println(" baseURI:"+ locator.getBaseSystemId());
> [Line 1684]
> }
> }
> fInDTD = true;
> if (locator != null) {
> fBaseURIStack.push(locator.getBaseSystemId());
> }
> if (fDeferNodeExpansion || fDocumentImpl != null) {
> fInternalSubset = new StringBuffer(1024);
> }
> } // startDTD(XMLLocator)
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]