Skip to content

Commit

Permalink
Add format to logging messages
Browse files Browse the repository at this point in the history
  • Loading branch information
estringana committed Feb 20, 2025
1 parent 1bf12b2 commit 361f307
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions appsec/src/extension/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ bool dd_report_exploit_backtrace(zend_string *nullable id)
array_init(meta_struct);
} else if (Z_TYPE_P(meta_struct) != IS_ARRAY) {
if (!get_global_DD_APPSEC_TESTING()) {
mlog(dd_log_trace, "Field meta_struct is not an array");
mlog(dd_log_trace,
"Field 'meta_struct' is of type '%d', expected 'array'",
Z_TYPE_P(meta_struct));
}
return false;
}
Expand All @@ -262,15 +264,18 @@ bool dd_report_exploit_backtrace(zend_string *nullable id)
mlog(dd_log_trace, "Backtrace stack created");
} else if (Z_TYPE_P(dd_stack) != IS_ARRAY) {
if (!get_global_DD_APPSEC_TESTING()) {
mlog(dd_log_trace, "Field stack is not an array");
mlog(dd_log_trace,
"Field 'stack' is of type '%d', expected 'array'",
Z_TYPE_P(dd_stack));
}
return false;
} else {
exploit = zend_hash_find(Z_ARR_P(dd_stack), _exploit_key);
}

if (Z_TYPE_P(exploit) != IS_ARRAY) {
mlog(dd_log_trace, "Field exploit is not an array");
mlog(dd_log_trace, "Field 'exploit' is of type '%d', expected 'array'",
Z_TYPE_P(exploit));
return false;
}

Expand Down

0 comments on commit 361f307

Please sign in to comment.