From 5c6a78cee077622ee85b56ab51f1e81b56878c22 Mon Sep 17 00:00:00 2001 From: Erki Aring Date: Mon, 3 Jul 2023 14:27:21 +0300 Subject: [PATCH] Don't spray XML parser errors to stderr --- apache2/msc_xml.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apache2/msc_xml.c b/apache2/msc_xml.c index 5b5bbb1a25..9ebfd101bd 100644 --- a/apache2/msc_xml.c +++ b/apache2/msc_xml.c @@ -19,6 +19,9 @@ xml_unload_external_entity(const char *URI, xmlCharEncoding enc) { return NULL; } +static void xml_error_func(void *ctx, const char *msg, ...) { + //modsec_rec *msr = (modsec_rec *)ctx; +} /** * Initialise XML parser. @@ -32,6 +35,8 @@ int xml_init(modsec_rec *msr, char **error_msg) { msr->xml = apr_pcalloc(msr->mp, sizeof(xml_data)); if (msr->xml == NULL) return -1; + xmlSetGenericErrorFunc(msr, xml_error_func); + if(msr->txcfg->xml_external_entity == 0) { entity = xmlParserInputBufferCreateFilenameDefault(xml_unload_external_entity); }