Commit 9b46826
committed
Fix posix_getgrnam()/posix_getgrgid() crash on NULL group name
php_posix_group_to_array() passed gr_name straight to add_assoc_string()
with no NULL guard, so a NULL group name segfaults via zend_string_init(),
while the sibling gr_passwd field right below is already guarded. glibc's
files NSS backend normalizes empty fields to "", but third-party NSS
modules (nss-systemd, nss-ldap, sssd and other directory backends)
populate struct group directly and may leave gr_name NULL. Guard it and
emit null instead, matching the existing gr_passwd handling.1 parent 6a323eb commit 9b46826
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
672 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
673 | 677 | | |
674 | 678 | | |
675 | 679 | | |
| |||
0 commit comments