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/ChangeLog b/ChangeLog
index c8cf83b..e32197b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 31 16:51:28 CEST 2001 Daniel Veillard <daniel@veillard.com>
+
+	* libxml.4 parser.c: doc updates from Heiko Rupp
+	* parserInternals.c: 2 sanity checks from Heiko Rupp
+
 Tue Aug 28 22:38:45 CEST 2001 Daniel Veillard <daniel@veillard.com>
 
 	* tree.c: applied patch from Armin Sander to make some pointers
diff --git a/libxml.4 b/libxml.4
index 6b8f5ce..62d9c7d 100644
--- a/libxml.4
+++ b/libxml.4
@@ -63,4 +63,9 @@
 Manual page by Ziying Sherwin (sherwin@nlm.nih.gov),
 Lister Hill National Center for Biomedical Communications,
 U.S. National Library of Medicine.
+.SH SEE ALSO
+.IR xmllint (1),
+.IR libxslt (4),
+.IR libexslt (4),
+.IR xsltproc (1)
 .\" end of manual page
diff --git a/parser.c b/parser.c
index 8f7646e..8aa5ab1 100644
--- a/parser.c
+++ b/parser.c
@@ -22,7 +22,7 @@
  * The DOM tree build is realized from the default SAX callbacks in
  * the module SAX.c.
  * The routines doing the validation checks are in valid.c and called either
- * from the SAx callbacks or as standalones functions using a preparsed
+ * from the SAX callbacks or as standalones functions using a preparsed
  * document.
  *
  * See Copyright for the status of this software.
@@ -9773,7 +9773,8 @@
  * parse an XML file and build a tree. Automatic support for ZLIB/Compress
  * compressed document is provided by default if found at compile-time.
  *
- * Returns the resulting document tree
+ * Returns the resulting document tree if the file was wellformed,
+ * NULL otherwise.
  */
 
 xmlDocPtr
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);
 }