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/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,