Logic error in html parser
In the function htmlCheckEncodingDirect()
if (ctxt->input->encoding != NULL)
return;
if (encoding != NULL) {
xmlCharEncoding enc;
xmlCharEncodingHandlerPtr handler;
while ((*encoding == ' ') || (*encoding == '\t')) encoding++;
if (ctxt->input->encoding != NULL)
xmlFree((xmlChar *) ctxt->input->encoding);
The second checking of "ctxt->input->encoding" against NULL is useless.
Probably the first checking should be for equality to NULL?