doc updates from Heiko Rupp 2 sanity checks from Heiko Rupp Daniel
* libxml.4 parser.c: doc updates from Heiko Rupp
* parserInternals.c: 2 sanity checks from Heiko Rupp
Daniel
diff --git a/parserInternals.c b/parserInternals.c
index 8e652b3..40aa0b1 100644
--- a/parserInternals.c
+++ b/parserInternals.c
@@ -2144,6 +2144,12 @@
{
xmlSAXHandler *sax;
+ if(ctxt==NULL) {
+ xmlGenericError(xmlGenericErrorContext,
+ "xmlInitParserCtxt: NULL context given\n");
+ return;
+ }
+
xmlDefaultSAXHandlerInit();
sax = (xmlSAXHandler *) xmlMalloc(sizeof(xmlSAXHandler));
@@ -2360,6 +2366,8 @@
void
xmlClearParserCtxt(xmlParserCtxtPtr ctxt)
{
+ if (ctxt==NULL)
+ return;
xmlClearNodeInfoSeq(&ctxt->node_seq);
xmlInitParserCtxt(ctxt);
}