1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-08-13 21:49:22 +03:00

malloc-fail: Report malloc failure in xmlXPathNumberFunction

This commit is contained in:
Nick Wellnhofer
2023-12-20 14:40:27 +01:00
parent 355fbe3ab7
commit bcefef202e

View File

@ -8614,6 +8614,8 @@ xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs) {
valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, 0.0));
} else {
xmlChar* content = xmlNodeGetContent(ctxt->context->node);
if (content == NULL)
xmlXPathPErrMemory(ctxt, NULL);
res = xmlXPathStringEvalNumber(content);
valuePush(ctxt, xmlXPathCacheNewFloat(ctxt, res));