Skip to content

Commit

Permalink
Fix closures on PHP 8.4 (#2812)
Browse files Browse the repository at this point in the history
  • Loading branch information
estringana authored Aug 26, 2024
1 parent 81fae34 commit 86afb44
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions appsec/src/extension/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
//
// This product includes software developed at Datadog
// (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
#include "compatibility.h"
#include "backtrace.h"
#include "compatibility.h"
#include "configuration.h"
#include "ddtrace.h"
#include "logging.h"
Expand Down Expand Up @@ -64,7 +64,10 @@ php_backtrace_frame_to_datadog_backtrace_frame( // NOLINTNEXTLINE(bugprone-easil
}

// Remove tracer integration php code frames
if (strncmp(Z_STRVAL_P(function), "DDTrace", sizeof("DDTrace") - 1) == 0) {
if (STR_STARTS_WITH_CONS(
Z_STRVAL_P(function), Z_STRLEN_P(function), "DDTrace") ||
STR_STARTS_WITH_CONS(
Z_STRVAL_P(function), Z_STRLEN_P(function), "{closure:DDTrace")) {
return false;
}

Expand Down

0 comments on commit 86afb44

Please sign in to comment.