mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
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.
This commit is contained in:
15
xpath.c
15
xpath.c
@@ -14137,12 +14137,12 @@ xmlXPathCtxtCompile(xmlXPathContextPtr ctxt, const xmlChar *str) {
|
||||
#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 @@ xmlXPathEvalExpr(xmlXPathParserContextPtr ctxt) {
|
||||
#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,
|
||||
|
Reference in New Issue
Block a user