mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Add nullptr check conditions
This commit is contained in:
parent
b42602f400
commit
3e95614699
@ -254,7 +254,8 @@ bool XML::processChunk(const char *buf, unsigned int size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Not a first invocation. */
|
/* Not a first invocation. */
|
||||||
if (m_transaction->m_secXMLParseXmlIntoArgs
|
if (m_data.parsing_ctx != NULL &&
|
||||||
|
m_transaction->m_secXMLParseXmlIntoArgs
|
||||||
!= RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs) {
|
!= RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs) {
|
||||||
xmlSetGenericErrorFunc(m_data.parsing_ctx, null_error);
|
xmlSetGenericErrorFunc(m_data.parsing_ctx, null_error);
|
||||||
xmlParseChunk(m_data.parsing_ctx, buf, size, 0);
|
xmlParseChunk(m_data.parsing_ctx, buf, size, 0);
|
||||||
@ -266,7 +267,8 @@ bool XML::processChunk(const char *buf, unsigned int size,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_transaction->m_secXMLParseXmlIntoArgs
|
if (m_data.parsing_ctx_arg != NULL &&
|
||||||
|
m_transaction->m_secXMLParseXmlIntoArgs
|
||||||
== RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs ||
|
== RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs ||
|
||||||
m_transaction->m_secXMLParseXmlIntoArgs
|
m_transaction->m_secXMLParseXmlIntoArgs
|
||||||
== RulesSetProperties::TrueConfigXMLParseXmlIntoArgs) {
|
== RulesSetProperties::TrueConfigXMLParseXmlIntoArgs) {
|
||||||
@ -286,7 +288,8 @@ bool XML::processChunk(const char *buf, unsigned int size,
|
|||||||
bool XML::complete(std::string *error) {
|
bool XML::complete(std::string *error) {
|
||||||
/* Only if we have a context, meaning we've done some work. */
|
/* Only if we have a context, meaning we've done some work. */
|
||||||
if (m_data.parsing_ctx != NULL || m_data.parsing_ctx_arg != NULL) {
|
if (m_data.parsing_ctx != NULL || m_data.parsing_ctx_arg != NULL) {
|
||||||
if (m_transaction->m_secXMLParseXmlIntoArgs
|
if (m_data.parsing_ctx != NULL &&
|
||||||
|
m_transaction->m_secXMLParseXmlIntoArgs
|
||||||
!= RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs) {
|
!= RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs) {
|
||||||
/* This is how we signalise the end of parsing to libxml. */
|
/* This is how we signalise the end of parsing to libxml. */
|
||||||
xmlParseChunk(m_data.parsing_ctx, NULL, 0, 1);
|
xmlParseChunk(m_data.parsing_ctx, NULL, 0, 1);
|
||||||
@ -307,10 +310,14 @@ bool XML::complete(std::string *error) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (m_transaction->m_secXMLParseXmlIntoArgs
|
if (m_data.parsing_ctx_arg != NULL &&
|
||||||
== RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs ||
|
(
|
||||||
m_transaction->m_secXMLParseXmlIntoArgs
|
m_transaction->m_secXMLParseXmlIntoArgs
|
||||||
== RulesSetProperties::TrueConfigXMLParseXmlIntoArgs) {
|
== RulesSetProperties::OnlyArgsConfigXMLParseXmlIntoArgs
|
||||||
|
||
|
||||||
|
m_transaction->m_secXMLParseXmlIntoArgs
|
||||||
|
== RulesSetProperties::TrueConfigXMLParseXmlIntoArgs)
|
||||||
|
) {
|
||||||
/* This is how we signalise the end of parsing to libxml. */
|
/* This is how we signalise the end of parsing to libxml. */
|
||||||
if (xmlParseChunk(m_data.parsing_ctx_arg, NULL, 0, 1) != 0) {
|
if (xmlParseChunk(m_data.parsing_ctx_arg, NULL, 0, 1) != 0) {
|
||||||
if (m_data.xml_error != "") {
|
if (m_data.xml_error != "") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user