Skip to content

Commit 5383c94

Browse files
committed
use NRSAFESTR when printing strings that can be NULL
1 parent c883e84 commit 5383c94

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

agent/php_observer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ static zend_observer_fcall_handlers nr_php_fcall_register_handlers(
101101
if (nrl_should_print(NRL_VERBOSEDEBUG, NRL_INSTRUMENT)) {
102102
char* name = nr_php_function_debug_name(execute_data->func);
103103
nrl_verbosedebug(NRL_INSTRUMENT, "%s - %s is a trampoline function",
104-
__func__, name);
104+
__func__, NRSAFESTR(name));
105105
nr_free(name);
106106
}
107107
return handlers;

agent/php_user_instrument.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static inline void nr_php_wraprec_lookup_set(nruserfn_t* wr,
124124
if (nrl_should_print(NRL_VERBOSEDEBUG, NRL_INSTRUMENT)) {
125125
char* name = nr_php_function_debug_name(zf);
126126
nrl_verbosedebug(NRL_INSTRUMENT, "%s - %s is a trampoline function",
127-
__func__, name);
127+
__func__, NRSAFESTR(name));
128128
nr_free(name);
129129
}
130130

@@ -155,7 +155,7 @@ static inline nruserfn_t* nr_php_wraprec_lookup_get(zend_function* zf) {
155155
if (nrl_should_print(NRL_VERBOSEDEBUG, NRL_INSTRUMENT)) {
156156
char* name = nr_php_function_debug_name(zf);
157157
nrl_verbosedebug(NRL_INSTRUMENT, "%s - %s is a trampoline function",
158-
__func__, name);
158+
__func__, NRSAFESTR(name));
159159
nr_free(name);
160160
}
161161
return NULL;
@@ -168,7 +168,7 @@ static inline nruserfn_t* nr_php_wraprec_lookup_get(zend_function* zf) {
168168
if (nrl_should_print(NRL_VERBOSEDEBUG, NRL_INSTRUMENT)) {
169169
char* name = nr_php_function_debug_name(zf);
170170
nrl_verbosedebug(NRL_INSTRUMENT, "%s - wraprec for {%s} is invalid",
171-
__func__, name);
171+
__func__, NRSAFESTR(name));
172172
nr_free(name);
173173
}
174174
wraprec = NULL;

0 commit comments

Comments
 (0)