On 9/13/2011 9:06 AM, Martin Elzen wrote:
Uh, sorry, that code is in XalanUTF16Writer.hpp (the *header* file as
opposed to the implementation file)
*From:*Martin Elzen [mailto:martin.el...@usoft.com]
*Sent:* Tuesday, September 13, 2011 6:03 PM
*To:* xalan-dev@xml.apache.org
*Subject:* XalanUTF16Writer.hpp sizeof-buffer code incorrect?
Hi all,
Today a client of ours told us about a crash they were experiencing with
the version of Xalan we use.
After looking into it, it seems to us that the sizeof-buffer
determination within the first if in XalanUTF16Writer::write (line 119
of XalanUTF16Writer.cpp)
is not quite correct.
currently in the SVN version of today it is:
if (theLength > sizeof(m_buffer))
while we think it ought to be:
if ( theLength > (sizeof(m_buffer) / sizeof(value_type) ) )
has anyone else run into this?
Yes, you're correct, that's a bug. A bug which has existed for many,
many years. I guess not too many people have been generating UTF-16 output.
I think a better fix is:
if (theLength > kBufferSize)
rather than:
if (theLength > sizeof(m_buffer) / sizeof(value_type))
Can you create a Jira issue to track this?
Thanks!
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org
For additional commands, e-mail: xalan-dev-h...@xml.apache.org