[xml] element name, content share memory



I ran into what might be a bug when debugging my application.

Given the document
<root>
   <X>X</X>
</root>

The memory address of the 'X' element's content is the same as the memory address of the 'X' element's name field of its xmlNode. This seems to happen when the content of an element is the same as the name of the element and both are 3 characters or less.

(Note: I'm using xmlReadMemory() to parse the document)

The problem becomes apparent when I change the content of X, thus changing the name of the tag itself.

Has this been reported/fixed?
My version info:
  xmllint: using libxml version 20608
compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude Unicode Regexps Automata Schemas

   Linux, Fedora Core 2.

- Cory Virok



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