[xml] xmlValidGetValidElements () can core.



Hi list,

I have encountered a core occuring in the function
xmlValidGetGetValidElement () (valid.c) 
of libxml2-2.4.26.

The core is due to the fact that some fields of
the vctxt variable are not initialyzed.

Then this function (xmlValidGetValidElement () )
calls xmlValidateOneElement () and passes it the 
vctxt. 

Then xmlValidateOneElement () calls
xmlValidateOneCdataElement () (in my particular case).

Then (now it's the end :-) )
xmlValidateOneCdataElement () frees
vctxt->nodeTab if this one is not NULL. (line 4254)

The pb is that vctxt->nodeTab not being NULL is the
result of a non initialisation of vctxt => core dump.

Here is a patch that fixes the pb on my machine.
It is the result of 
"diff -c valid.c.old valid.c > valid.patch".

I've just initialyzed the variable.

I hope i've not broken anything.

Sorry for the poor quality of my english and for any
other mistake i could have made.

=====
Dodji Seketeli.
http://www.advogato.org/person/sdodji

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com

Attachment: valid.c.patch
Description: valid.c.patch



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