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 "Boris Kolpackov (JIRA)" <xe...@xml.apache.org> on 2008/08/06 16:50:44 UTC

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

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
            Priority: Critical
             Fix For: 3.1.0


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


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

Posted by "Boris Kolpackov (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Boris Kolpackov updated XERCESC-1825:
-------------------------------------

    Attachment: test.xml
                test.xsd

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


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

Posted by "Alberto Massari (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alberto Massari resolved XERCESC-1825.
--------------------------------------

    Resolution: Fixed
      Assignee: Alberto Massari  (was: cargilld)

> 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: Alberto Massari
>            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


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

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
    [ 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


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

Posted by "cargilld (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESC-1825?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

cargilld reassigned XERCESC-1825:
---------------------------------

    Assignee: cargilld

> 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