From cd029431e1ec42a4d5e931c96033ad788d86466e Mon Sep 17 00:00:00 2001 From: Pierre Le Marre Date: Sun, 13 Oct 2024 19:52:15 +0200 Subject: [PATCH] registry: Set libxml2 context options --- src/registry.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/registry.c b/src/registry.c index f75f3849..9da5b0a8 100644 --- a/src/registry.c +++ b/src/registry.c @@ -1264,6 +1264,13 @@ parse(struct rxkb_context *ctx, const char *path, if (!xmlCtxt) return false; +#ifdef XML_PARSE_NO_XXE +#define _XML_OPTIONS (XML_PARSE_NONET | XML_PARSE_NOENT | XML_PARSE_NO_XXE) +#else +#define _XML_OPTIONS (XML_PARSE_NONET) +#endif + xmlCtxtUseOptions(xmlCtxt, _XML_OPTIONS); + #ifdef HAVE_XML_CTXT_SET_ERRORHANDLER /* Prefer contextual handler whenever possible. It takes precedence over * the global generic handler. */