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:
9
xpath.c
9
xpath.c
@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user