[xml] xmlRemoveID bug and a patch




Hi,

I would like to draw your attention to the xmlRemoveID function in the
valid.c file of the libxml2 tree. I have noticed a bug in that this
function does not actually do what it is intended for and remove the ID
from the internal ID hash table. I have attached a patch that rectifies
this. I made it against libxml2-2.5.10, but I notice that the problem
still exists in the CVS repository. I would have patched it against that, 
but couldn't get the anonymous access working.

Also, I would like to request either some documentation or functionality 
changes of the following functions:

xmlSetProp (and xmlNewProp) - these functions will NOT call xmlRemoveID or 
xmlAddID on any ID properties. I think that they either should, if 
necessary, or it be explicitly documented that they do not.

xmlUnsetProp, or xmlFreeProp to be more precise - will xmlRemoveID if 
necessary. This doesn't seem symmetrical with the xmlSetProp as the name 
implies and led me to memory being freed twice errors.


Finally, I think that the same functions regarding to ID references have 
the same problems. I haven't touched these, but it should probably be 
fixed or noted as a bug aswell.

I hope this is of some help.

-bill


----


William Robinson
baggins elitemail org
http://www.hobbiton.cjb.net/

Attachment: valid.c.patch
Description: Text document



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