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 

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
This case occurres if a hexBinary Node looks like this: <node/>.

  Hum, I can't reproduce this:

paphio:~/XML -> cat tst.xml
paphio:~/XML -> cat tst.rng
<element name="node" xmlns="";
  <data type="hexBinary"/>
paphio:~/XML -> xmllint --noout --relaxng tst.rng tst.xml
tst.xml validates
paphio:~/XML ->

 what's missing ?


Daniel Veillard      | Red Hat Network
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine
xml mailing list, project page
xml gnome org

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