1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-24 13:33:01 +03:00

encoding: Report malloc failures

Introduce new API functions that return a separate error code if a
memory allocation fails.

- xmlOpenCharEncodingHandler
- xmlLookupCharEncodingHandler

Fix a few places where malloc failures weren't reported.
This commit is contained in:
Nick Wellnhofer
2023-12-10 14:56:21 +01:00
parent da996c8d0f
commit bd5ad0308d
4 changed files with 416 additions and 249 deletions

View File

@@ -373,6 +373,18 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info)
case XML_IO_UNKNOWN:
errmsg = "I/O error";
break;
case XML_ERR_RESOURCE_LIMIT:
errmsg = "Resource limit exceeded";
break;
case XML_ERR_ARGUMENT:
errmsg = "Invalid argument";
break;
case XML_ERR_SYSTEM:
errmsg = "Out of system resources";
break;
case XML_ERR_REDECL_PREDEF_ENTITY:
errmsg = "Invalid redeclaration of predefined entity";
break;
#if 0
case:
errmsg = "";