mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-11-15 09:02:15 +03:00
Fix libxml2 related deprecated issues
This commit is contained in:
@@ -33,12 +33,6 @@ bool ValidateDTD::init(const std::string &file, std::string *error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
xmlThrDefSetGenericErrorFunc(NULL,
|
||||
null_error);
|
||||
|
||||
xmlSetGenericErrorFunc(NULL,
|
||||
null_error);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -78,9 +78,6 @@ class ValidateDTD : public Operator {
|
||||
}
|
||||
|
||||
|
||||
static void null_error(void *, const char *, ...) { // cppcheck-suppress[constParameterPointer,constParameterCallback]
|
||||
}
|
||||
|
||||
private:
|
||||
std::string m_resource;
|
||||
#endif
|
||||
|
||||
@@ -71,12 +71,6 @@ bool ValidateSchema::evaluate(Transaction *transaction,
|
||||
(xmlSchemaValidityErrorFunc)error_load,
|
||||
(xmlSchemaValidityWarningFunc)warn_load, &m_err);
|
||||
|
||||
xmlThrDefSetGenericErrorFunc(parserCtx,
|
||||
null_error);
|
||||
|
||||
xmlSetGenericErrorFunc(parserCtx,
|
||||
null_error);
|
||||
|
||||
xmlSchemaPtr schema = xmlSchemaParse(parserCtx);
|
||||
if (schema == NULL) {
|
||||
std::stringstream err;
|
||||
|
||||
@@ -75,8 +75,6 @@ class ValidateSchema : public Operator {
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
static void null_error(void *, const char *, ...) { // cppcheck-suppress[constParameterPointer,constParameterCallback]
|
||||
}
|
||||
|
||||
template<typename Pred>
|
||||
static void callback_func(void *ctx, Pred pred, const char *base_msg, const char *msg, va_list args) {
|
||||
|
||||
@@ -274,7 +274,6 @@ bool XML::processChunk(const char *buf, unsigned int size,
|
||||
if (m_data.parsing_ctx != NULL &&
|
||||
m_transaction->m_secXMLParseXmlIntoArgs
|
||||
!= RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs) {
|
||||
xmlSetGenericErrorFunc(m_data.parsing_ctx, null_error);
|
||||
xmlParseChunk(m_data.parsing_ctx, buf, size, 0);
|
||||
m_data.xml_parser_state->parsing_ctx_arg = m_data.parsing_ctx_arg;
|
||||
if (m_data.parsing_ctx->wellFormed != 1) {
|
||||
@@ -292,7 +291,6 @@ bool XML::processChunk(const char *buf, unsigned int size,
|
||||
m_transaction->m_secXMLParseXmlIntoArgs
|
||||
== RulesSetProperties::TrueConfigXMLParseXmlIntoArgs)
|
||||
) {
|
||||
xmlSetGenericErrorFunc(m_data.parsing_ctx_arg, null_error);
|
||||
xmlParseChunk(m_data.parsing_ctx_arg, buf, size, 0);
|
||||
if (m_data.parsing_ctx_arg->wellFormed != 1) {
|
||||
error->assign("XML: Failed to parse document for ARGS.");
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#ifdef WITH_LIBXML2
|
||||
#include <libxml/xmlschemas.h>
|
||||
#include <libxml/xpath.h>
|
||||
#include <libxml/SAX.h>
|
||||
#include <libxml/SAX2.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
@@ -93,10 +93,6 @@ class XML {
|
||||
static xmlParserInputBufferPtr unloadExternalEntity(const char *URI,
|
||||
xmlCharEncoding enc);
|
||||
|
||||
static void null_error(void *ctx, const char *msg, ...) { // cppcheck-suppress[constParameterPointer,constParameterCallback]
|
||||
}
|
||||
|
||||
|
||||
xml_data m_data;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user