You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "cargilld (JIRA)" <xe...@xml.apache.org> on 2008/08/14 16:21:44 UTC

[jira] Commented: (XERCESC-1825) Default value of QName type with non-empty prefix causes segfault

    [ https://issues.apache.org/jira/browse/XERCESC-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622562#action_12622562 ] 

cargilld commented on XERCESC-1825:
-----------------------------------

Looks like when a qname is in an attribute there is a ValidationContext (in element it isn't) and the code is only checking to see if there is an fContext.  That check needs to be updated to also see if there is a valid value for ElemStack.

A less clean hack is to change:
bool ValidationContextImpl::isPrefixUnknown(XMLCh* prefix) {     
    bool unknown = false;
    if (XMLString::equals(prefix, XMLUni::fgXMLNSString)) {
        return true;                
    }            
    else if (!XMLString::equals(prefix, XMLUni::fgXMLString)) {
        if (fElemStack == 0) return false;
        unsigned int uriId = fElemStack->mapPrefixToURI(prefix, (ElemStack::MapModes) ElemStack::Mode_Element, unknown);                
    }                
    return unknown;
}

Adding in the if (fElemStack == 0) return false; line.  I prefer to add a hasElemStack method to ValidationContext.

> Default value of QName type with non-empty prefix causes segfault
> -----------------------------------------------------------------
>
>                 Key: XERCESC-1825
>                 URL: https://issues.apache.org/jira/browse/XERCESC-1825
>             Project: Xerces-C++
>          Issue Type: Bug
>          Components: Validating Parser (XML Schema)
>    Affects Versions: 2.8.0, 3.0.0
>            Reporter: Boris Kolpackov
>            Assignee: cargilld
>            Priority: Critical
>             Fix For: 3.1.0
>
>         Attachments: test.xml, test.xsd
>
>
> See the attached test case. I am not even sure why we try to resolve the prefix in the default value in the context of schema. I always thought (perhaps wrongly) that those must resolve only in the context of the instance document.

-- 
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: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org