Commit 21bf7f6
authored
phpdbg: Fix off-by-one in phpdbg_safe_class_lookup() signal-safe class lookup (php#22593)
lc_length was set to name_length + 1, one past the actual lowercased
string length, so zend_hash_str_find_ptr() (which expects a strlen-style
length) never matched an existing class entry. This made class lookups
during phpdbg's signal-handler interruption path always fail silently.
Replaced the manual emalloc/tolower/efree dance with
zend_hash_str_find_ptr_lc(), which performs the lowercase copy and
lookup in one call and removes the surface for this class of bug.1 parent cf2f699 commit 21bf7f6
2 files changed
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
397 | 397 | | |
398 | 398 | | |
399 | 399 | | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | 400 | | |
404 | 401 | | |
405 | 402 | | |
406 | 403 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
414 | 407 | | |
415 | 408 | | |
416 | 409 | | |
417 | | - | |
| 410 | + | |
418 | 411 | | |
419 | 412 | | |
420 | 413 | | |
421 | | - | |
422 | | - | |
423 | 414 | | |
424 | 415 | | |
425 | 416 | | |
| |||
0 commit comments