1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-04-24 18:50:07 +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:
Kasimier T. Buchcik 2006-06-06 15:27:46 +00:00
parent 69839ba197
commit 7cb3fa9d51
2 changed files with 14 additions and 7 deletions

View File

@ -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

15
xpath.c
View File

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