Skip to content

Commit 575aa95

Browse files
committed
fixup! b887845
Document input validation requirements for functions that no longer do that because it is expected to be done upstream.
1 parent 64408b5 commit 575aa95

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

agent/php_user_instrument.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,13 @@ nruserfn_t* nr_php_user_wraprec_create(void) {
353353
}
354354

355355
#if ZEND_MODULE_API_NO < ZEND_8_0_X_API_NO
356+
357+
/* This function expects full_name and full_name_len to be validated with
358+
* nr_php_user_instrument_is_name_valid() before being passed in.
359+
* Specifically, it requires that:
360+
* - full_name_len be greater than 0
361+
* - full_name must not be NULL and must not end with `:` (colon) . */
362+
356363
static nruserfn_t* nr_php_user_wraprec_create_named(const char* full_name,
357364
int full_name_len) {
358365
int i;

agent/php_user_instrument_wraprec_hashmap.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,12 @@ nr_status_t nr_php_user_instrument_wraprec_hashmap_init(void) {
393393
return NR_SUCCESS;
394394
}
395395

396+
/* This function expects namestr and namestrlen to be validated with
397+
* nr_php_user_instrument_is_name_valid() before being passed in.
398+
* Specifically, it requires that:
399+
* - namestrlen be greater than 0
400+
* - namestr must not be NULL and must not end with `:` (colon) . */
401+
396402
nruserfn_t* nr_php_user_instrument_wraprec_hashmap_add(const char* namestr, size_t namestrlen) {
397403
nr_scope_hashmap_key_t scope_key = {0};
398404
nr_func_hashmap_key_t func_key = {0};

0 commit comments

Comments
 (0)