Missing Fixes 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


The fix revision 318567 was aimed to remove an NPE bug on "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 also be made in is copied 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]

Reply via email to