Return-Path: X-Original-To: apmail-xalan-dev-archive@www.apache.org Delivered-To: apmail-xalan-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F3852D5F6 for ; Tue, 14 May 2013 19:31:16 +0000 (UTC) Received: (qmail 76038 invoked by uid 500); 14 May 2013 19:31:16 -0000 Delivered-To: apmail-xalan-dev-archive@xalan.apache.org Received: (qmail 75935 invoked by uid 500); 14 May 2013 19:31:16 -0000 Mailing-List: contact dev-help@xalan.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@xalan.apache.org Delivered-To: mailing list dev@xalan.apache.org Received: (qmail 75918 invoked by uid 99); 14 May 2013 19:31:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 May 2013 19:31:16 +0000 Date: Tue, 14 May 2013 19:31:15 +0000 (UTC) From: "Michael Chisholm (JIRA)" To: dev@xalan.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (XALANC-744) XalanLocator::getSystemId() can return NULL, cause crash MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Michael Chisholm created XALANC-744: --------------------------------------- Summary: XalanLocator::getSystemId() can return NULL, cause crash Key: XALANC-744 URL: https://issues.apache.org/jira/browse/XALANC-744 Project: XalanC Issue Type: Bug Components: XalanC Affects Versions: 1.11 Environment: Windows, Visual Studio 2010 Reporter: Michael Chisholm Assignee: Steven J. Hathaway Priority: Critical I think this is a copy-paste bug, introduced in r1388736: Index: XalanLocator.hpp =================================================================== --- XalanLocator.hpp (revision 1388735) +++ XalanLocator.hpp (revision 1388736) @@ -67,17 +67,19 @@ static const XalanDOMChar* getPublicId( const Locator* theLocator, - const XalanDOMChar* theAlternateId = 0) + const XalanDOMChar* theAlternateId = &s_dczero) { - return theLocator == 0 ? theAlternateId : theLocator->getPublicId(); + return theLocator == 0 ? theAlternateId : (theLocator->getPublicId() ? + theLocator->getPublicId() : theAlternateId); } static const XalanDOMChar* getSystemId( const Locator* theLocator, - const XalanDOMChar* theAlternateId = 0) + const XalanDOMChar* theAlternateId = &s_dczero) { - return theLocator == 0 ? theAlternateId : theLocator->getSystemId(); + return theLocator == 0 ? theAlternateId : (theLocator->getSystemId() ? + theLocator->getPublicId() : theAlternateId); } static XalanFileLoc @@ -122,6 +124,8 @@ XalanLocator& operator=(const XalanLocator&); + + const static XalanDOMChar s_dczero = 0; }; Notice that in the getSystemId() method, theLocator->getPublicId() is called. I think that was meant to be theLocator->getSystemId(). This caused a crash when I used Xalan.exe because it sets up its XSLTInputSources with system Ids, but not public Ids. Then, during transformation, XalanLocator::getSystemId() is called, which returns the NULL public Id, which is passed to the XalamDomString constructor, which causes the crash. I just switched the call to theLocator->getSystemId() and the crash disappeared. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@xalan.apache.org For additional commands, e-mail: dev-help@xalan.apache.org