Skip to content

Commit 250fd02

Browse files
committed
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: ext/posix: (Further) fix groups array creation on macos.
2 parents 2100ca0 + e63dae2 commit 250fd02

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ PHP NEWS
3939
. Fix build on legacy OpenSSL 1.1.0 systems. (Giovanni Giacobbi)
4040
. Fixed bug #74154 (Phar extractTo creates empty files). (ndossche)
4141

42+
- POSIX:
43+
. Fixed crash on posix groups to php array creation on macos.
44+
(David Carlier)
45+
4246
- SPL:
4347
. Fixed bug GH-20678 (resource created by GlobIterator crashes with fclose()).
4448
(David Carlier)

ext/posix/posix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,8 @@ int php_posix_group_to_array(struct group *g, zval *array_group) /* {{{ */
678678
for (count = 0;; count++) {
679679
/* gr_mem entries may be misaligned on macos. */
680680
char *gr_mem;
681-
memcpy(&gr_mem, &g->gr_mem[count], sizeof(char *));
681+
char *entry = (char *)g->gr_mem + (count * sizeof (char *));
682+
memcpy(&gr_mem, entry, sizeof(char *));
682683
if (!gr_mem) {
683684
break;
684685
}

0 commit comments

Comments
 (0)