[ expat-Bugs-1064174 ] XML_GetBuffer / ParseBuffer bug

"SourceForge.net" <[email protected]>
Newsgroups gmane.text.xml.expat.bugs
Message-ID <[email protected]>
Bugs item #1064174, was opened at 2004-11-10 17:20
Message generated for change (Comment added) made by kwaclaw
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1064174&group_id=10127

Category: None
Group: None
Status: Open
>Resolution: Rejected
Priority: 5
Submitted By: Werner BEROUX (wernight)
Assigned to: Nobody/Anonymous (nobody)
Summary: XML_GetBuffer / ParseBuffer bug

Initial Comment:
I saw the bug by a little different code than the one
under but this one bug and can be checked really fast.

I do:
Assigne EnableStartElementHandler,
EnableEndElementHandler, EnableCharacterDataHandler().

XML_ParserCreate_MM(NULL, NULL, NULL);
XML_GetBuffer(257);
int nLength = file.Read(pszBuffer, 256);
pszBuffer[nLength] = '\0'; // Don't forget this.
XML_ParseBuffer(nLength, nLength < 257); // Returns false.

Note that when I set buffer to 512 it works. I'm
calling the XML_GetBuffer() each time in the loop and
normally I don't put a closing '\0'.

Configuration:
- I'm using CExpatImpl from CodeProject. Which is only
a wrapper.
- eXpat 1.95.8 with XML_UNICODE_WCHAR_T and XML_STATIC
defined.
- PC AMD64 - WinXP

----------------------------------------------------------------------

>Comment By: Karl Waclawek (kwaclaw)
Date: 2004-11-10 17:40

Message:
Logged In: YES 
user_id=290026

It is wrong to append null to the end of the buffer.
this inserts an invalid character in the document.
Leave it out and try again. It should work.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=1064174&group_id=10127
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.