Fixed self-invented a segfault in xmlXPathCtxtCompile(), when the

* xpath.c: Fixed self-invented a segfault in xmlXPathCtxtCompile(),
  when the expression was not valid and @comp was NULL and I
  tried to do the d-o-s rewrite.
diff --git a/ChangeLog b/ChangeLog
index 3a3a8f1..9a39291 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jun  6 17:25:23 CEST 2006 Kasimier Buchcik <libxml2-cvs@cazic.net>
+
+	* xpath.c: Fixed self-invented a segfault in xmlXPathCtxtCompile(),
+	  when the expression was not valid and @comp was NULL and I
+	  tried to do the d-o-s rewrite.
+
 Tue Jun  6 15:19:57 CEST 2006 Daniel Veillard <daniel@veillard.com>
 
 	* configure.ini NEWS doc//* libxml.spec.in : preparing release of 2.6.25
diff --git a/xpath.c b/xpath.c
index ce62a56..c6c2274 100644
--- a/xpath.c
+++ b/xpath.c
@@ -14137,12 +14137,12 @@
 #ifdef DEBUG_EVAL_COUNTS
 	comp->string = xmlStrdup(str);
 	comp->nb = 0;
-#endif
-    }
-    if ((comp->nbStep > 2) &&
-	(xmlXPathCanRewriteDosExpression(comp->expr) == 1))
-    {
-	xmlXPathRewriteDOSExpression(comp, &comp->steps[comp->last]);
+#endif    
+	if ((comp->nbStep > 2) &&
+	    (xmlXPathCanRewriteDosExpression(comp->expr) == 1))
+	{
+	    xmlXPathRewriteDOSExpression(comp, &comp->steps[comp->last]);
+	}

     }
     return(comp);
 }
@@ -14263,7 +14263,8 @@
 #endif
     {
 	xmlXPathCompileExpr(ctxt, 1);
-	if ((ctxt->comp->nbStep > 2) &&
+	if ((ctxt->comp != NULL) &&

+	    (ctxt->comp->nbStep > 2) &&
 	    (xmlXPathCanRewriteDosExpression(ctxt->comp->expr) == 1))
 	{
 	    xmlXPathRewriteDOSExpression(ctxt->comp,