@@ -4,8 +4,7 @@ use crate::bindings::{
44 datadog_php_profiling_copy_string_view_into_zval, ddog_php_prof_get_memoized_config,
55 zai_config_entry, zai_config_get_value, zai_config_minit, zai_config_name,
66 zai_config_system_ini_change, zend_ini_entry, zend_long, zend_string, zend_write, zval,
7- StringError , ZaiStr , IS_FALSE , IS_LONG , IS_TRUE , ZAI_CONFIG_ENTRIES_COUNT_MAX ,
8- ZEND_INI_DISPLAY_ORIG ,
7+ StringError , ZaiStr , IS_FALSE , IS_LONG , IS_TRUE , ZAI_CONFIG_NAME_BUFSIZ , ZEND_INI_DISPLAY_ORIG ,
98} ;
109use crate :: zend:: zai_str_from_zstr;
1110use core:: fmt:: { Display , Formatter } ;
@@ -287,7 +286,7 @@ unsafe extern "C" fn env_to_ini_name(env_name: ZaiStr, ini_name: *mut zai_config
287286 // Env var name needs to fit.
288287 let projection = "datadog." . len ( ) - "DD_" . len ( ) ;
289288 let null_byte = 1usize ;
290- assert ! ( name. len( ) + projection + null_byte < ZAI_CONFIG_ENTRIES_COUNT_MAX as usize ) ;
289+ assert ! ( name. len( ) + projection + null_byte <= ( ZAI_CONFIG_NAME_BUFSIZ as usize ) ) ;
291290
292291 let ( dest_prefix, src_prefix) = if name. starts_with ( "DD_TRACE_" ) {
293292 ( "datadog.trace." , "DD_TRACE_" )
@@ -1276,6 +1275,10 @@ mod tests {
12761275 b"DD_PROFILING_ALLOCATION_ENABLED\0 " ,
12771276 "datadog.profiling.allocation_enabled" ,
12781277 ) ,
1278+ (
1279+ b"DD_PROFILING_EXPERIMENTAL_EXCEPTION_SAMPLING_DISTANCE\0 " ,
1280+ "datadog.profiling.experimental_exception_sampling_distance" ,
1281+ ) ,
12791282 (
12801283 b"DD_PROFILING_EXPERIMENTAL_TIMELINE_ENABLED\0 " ,
12811284 "datadog.profiling.experimental_timeline_enabled" ,
0 commit comments