File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,8 @@ PHP NEWS
6161 . Fixed bug GH-17387 (Trivial crash in phpdbg lexer). (iliaal)
6262 . Fixed fleaked lowercased lookup keys in phpdbg_resolve_opline_break.
6363 (jorgsowa)
64+ . Fixed off-by-one in phpdbg_safe_class_lookup() causing class lookups to
65+ always fail during phpdbg's signal-safe interruption path. (jorgsowa)
6466
6567- Reflection:
6668 . Fixed bug GH-22324 (Ignore leading namespace separator in
Original file line number Diff line number Diff line change @@ -397,29 +397,20 @@ PHPDBG_API void phpdbg_set_async_io(int fd) {
397397
398398int phpdbg_safe_class_lookup (const char * name , int name_length , zend_class_entry * * ce ) {
399399 if (PHPDBG_G (flags ) & PHPDBG_IN_SIGNAL_HANDLER ) {
400- char * lc_name , * lc_free ;
401- int lc_length ;
402-
403400 if (name == NULL || !name_length ) {
404401 return FAILURE ;
405402 }
406403
407- lc_free = lc_name = emalloc (name_length + 1 );
408- zend_str_tolower_copy (lc_name , name , name_length );
409- lc_length = name_length + 1 ;
410-
411- if (lc_name [0 ] == '\\' ) {
412- lc_name += 1 ;
413- lc_length -= 1 ;
404+ if (name [0 ] == '\\' ) {
405+ name += 1 ;
406+ name_length -= 1 ;
414407 }
415408
416409 phpdbg_try_access {
417- * ce = zend_hash_str_find_ptr (EG (class_table ), lc_name , lc_length );
410+ * ce = zend_hash_str_find_ptr_lc (EG (class_table ), name , name_length );
418411 } phpdbg_catch_access {
419412 phpdbg_error ("Could not fetch class %.*s, invalid data source" , name_length , name );
420413 } phpdbg_end_try_access ();
421-
422- efree (lc_free );
423414 } else {
424415 zend_string * str_name = zend_string_init (name , name_length , 0 );
425416 * ce = zend_lookup_class (str_name );
You can’t perform that action at this time.
0 commit comments