You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Dean O'Connor <De...@ite.com.au> on 2006/08/03 09:56:27 UTC

WindowsFileMgr bug in trunk

 
Attached it a patch for a bug in WindowsFileMgr.cpp
 
I discovered it when serialising XML to a file using DOMLSSerializer. 
If you serialise twice to the same file. But the 2nd time use larger XML
data, you will find that the new data is written to file ok, but the
file size is still set to the previous larger size.
So you will get artifact data from your old file still there.
Basically the file data integrity is corrupted.
 
It boiled down to a OPEN_ALWAYS being used instead of a CREATE_ALWAYS
for open with write.
 
Cheers
Dean.

Re: WindowsFileMgr bug in trunk

Posted by Alberto Massari <am...@datadirect.com>.
Hi Dean,
thanks for spotting this error; I checked in a change that makes 
open(const char*) reuse open(const XMLCh*) as the latter version 
already uses CREATE_ALWAYS and performs more checks on the provided path.
Let me know if the fix works also for you.

Thanks,
Alberto

At 17.56 03/08/2006 +1000, Dean O'Connor wrote:
>
>Attached it a patch for a bug in WindowsFileMgr.cpp
>
>I discovered it when serialising XML to a file using DOMLSSerializer.
>If you serialise twice to the same file. But the 2nd time use larger 
>XML data, you will find that the new data is written to file ok, but 
>the file size is still set to the previous larger size.
>So you will get artifact data from your old file still there.
>Basically the file data integrity is corrupted.
>
>It boiled down to a OPEN_ALWAYS being used instead of a 
>CREATE_ALWAYS for open with write.
>
>Cheers
>Dean.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
>For additional commands, e-mail: c-dev-help@xerces.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org