Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/operators/validate_dtd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 0 additions & 3 deletions src/operators/validate_dtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions src/operators/validate_schema.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions src/operators/validate_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
6 changes: 4 additions & 2 deletions src/request_body_processor/xml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ bool XML::processChunk(const char *buf, unsigned int size,
error->assign("XML: Failed to create parsing context.");
return false;
}
// disable parser errors being printed to stderr
m_data.parsing_ctx->options |= XML_PARSE_NOWARNING | XML_PARSE_NOERROR;
}

if (m_transaction->m_secXMLParseXmlIntoArgs
Expand All @@ -265,6 +267,8 @@ bool XML::processChunk(const char *buf, unsigned int size,
error->assign("XML: Failed to create parsing context for ARGS.");
return false;
}
// disable parser errors being printed to stderr
m_data.parsing_ctx_arg->options |= XML_PARSE_NOWARNING | XML_PARSE_NOERROR;
}

return true;
Expand All @@ -274,7 +278,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) {
Expand All @@ -292,7 +295,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.");
Expand Down
6 changes: 1 addition & 5 deletions src/request_body_processor/xml.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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:
Expand Down
Loading