Joe Marcus Clarke reported a segfault on FBsd this was due to

* valid.c: Joe Marcus Clarke reported a segfault on FBsd
  this was due to uninitialized parts of the validation context
Daniel
diff --git a/debugXML.c b/debugXML.c
index fabcd12..200fe4e 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -1355,17 +1355,23 @@
 static void
 xmlShellPrintNodeCtxt(xmlShellCtxtPtr ctxt,xmlNodePtr node)
 {
-    if (!ctxt || !node)
+    FILE *fp;
+
+    if (!node)
         return;
+    if (ctxt == NULL)
+	fp = stdout;
+    else
+	fp = ctxt->output;
 
     if (node->type == XML_DOCUMENT_NODE)
-        xmlDocDump(ctxt->output, (xmlDocPtr) node);
+        xmlDocDump(fp, (xmlDocPtr) node);
     else if (node->type == XML_ATTRIBUTE_NODE)
-        xmlDebugDumpAttrList(ctxt->output, (xmlAttrPtr) node, 0);
+        xmlDebugDumpAttrList(fp, (xmlAttrPtr) node, 0);
     else
-        xmlElemDump(ctxt->output, node->doc, node);
+        xmlElemDump(fp, node->doc, node);
 
-    fprintf(ctxt->output, "\n");
+    fprintf(fp, "\n");
 }
 
 /**