1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-01 10:06:59 +03:00

- xpath.c: fixed xmlXPathCompile to detected unproperly ended expr

Daniel
This commit is contained in:
Daniel Veillard
2001-04-22 08:50:55 +00:00
parent 70a9da54eb
commit 40af649f9b
2 changed files with 11 additions and 2 deletions

View File

@ -7433,8 +7433,13 @@ xmlXPathCompile(const xmlChar *str) {
ctxt = xmlXPathNewParserContext(str, NULL);
xmlXPathCompileExpr(ctxt);
comp = ctxt->comp;
ctxt->comp = NULL;
if (*ctxt->cur != 0) {
xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_EXPR_ERROR);
comp = NULL;
} else {
comp = ctxt->comp;
ctxt->comp = NULL;
}
xmlXPathFreeParserContext(ctxt);
return(comp);
}