Re: [xml] hexBinary type implementation in xmlschemastypes.c



I was able to reproduce the segmentation fault by modifying the item_0.
[xsd|xml] schema tests so that USPrice is hexBinary datatype and then set the 
USPrice element in item_0.xml to empty. The problem is I didn't check for NULL 
content. I don't have cvs access at work so I can't produce a patch until 
later. If you can wait, I will patch it tonight. All that is needed is:
line 1927 of xmlschemastypes.c
if (cur == NULL)
    goto return1;

I am planning to use strings to store the lexical hexBinary information 
instead of converting to binary so that any hexBinary value can be infinitely 
long. 

Good catch Peter.
C. Bozeman

Quoting Daniel Veillard <veillard redhat com>:

On Fri, Jul 11, 2003 at 01:25:40PM +0200, Peter Sobisch wrote:
Hi Daniel, Hi All,

the recently implementation of hexBinary in xmlschemastypes.c causes
segmentation fault if the value is a NULL pointer (because of char
comparison).
This case occurres if a hexBinary Node looks like this: <node/>.

  Hum, I can't reproduce this:

paphio:~/XML -> cat tst.xml
<node/>
paphio:~/XML -> cat tst.rng
<element name="node" xmlns="http://relaxng.org/ns/structure/1.0";
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
  <data type="hexBinary"/>
</element>
paphio:~/XML -> xmllint --noout --relaxng tst.rng tst.xml
tst.xml validates
paphio:~/XML ->

 what's missing ?

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit 
http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]