[xml] xmlSaveFormatFileEnc - xml file with binary zeros



Hi all.

At a customer site we had the case that one configuration file we always write from our app was 789KB of binary zeros (0x00 / '\0').

The call we use to save the file is:
xmlSaveFormatFileEnc(
  WCharToUTF8(m_csXMLFile).c_str(), // generate UTF8 name from CString
  m_xmldoc,
  XML_ENCODING_UTF8,
  1
);

I thought maybe someone has a creative idea what could have happened to our program state to create such a file through this call. (Of course the whole thing isn't reproducible :/ )

Note:
I have seen that saving the data ends up in xmlio.c:xmlFileWrite which calls fwrite(&buffer[0], len, 1, (FILE *) context) The call comes from xmlio.c:xmlOutputBufferFlush where the writecallback is invoked: ret = out->writecallback(out->context, (const char *)out->conv->content, out->conv->use);

So for libxml to actually generate such a file we'd need a valid xmlBufferPtr(out->conv) with a sufficiently large buffer that is zero'd out.
Not much chance for that, or??


Thx in adv for any ideas and pointers, libxml related or not!

cheers,
Martin



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