xml-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Quinlan" <Bri...@ActiveState.com>
Subject Possible Xerces C 1.4 crashing bug when encoding is incorrect
Date Fri, 01 Jun 2001 17:24:49 GMT
Sample document (UTF-8 encoded):
<?xml version="1.0" encoding="utf-16"?> ...

What seems to happen is that:

1.   XMLScanner guesses that the encoding is UTF-8
2.   XMLScanner reads the XML declaration and calls
setEncoding()
     with the encoding specified in the declaration
2.1  setEncoding deletes the current encoding string
(fEncodingStr)
     and sets it to NULL
2.2  setEncoding decides that the encoding is invalid and
returns
     false (at this point fEncodingStr is still NULL!)
3.   XMLScanner emits a warning and continues
4.   When XMLReader tries to make a transcoder using the
encoding
     string, it will crash with a NULL pointer exception

I couldn't find this bug on Bugzilla but is seems like this
must have come up before... Anyway, I'm looking for
workarounds unless there is an obvious one that someone else
has found :-)

--
Brian Quinlan
Python and XSLT Developer
BrianQ@ActiveState.com

Use the power of the dragon for your programming needs.
Download Komodo, our Mozilla-based, cross-platform IDE.
      http://www.ActiveState.com/Komodo




---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Mime
View raw message