Skip to content

Commit c1e450d

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: ext/posix: (Further) fix groups array creation on macos.
2 parents 4d1829c + fd1e730 commit c1e450d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/posix/posix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,8 @@ static void php_posix_group_to_array(struct group *g, zval *array_group) /* {{{
699699
for (count = 0;; count++) {
700700
/* gr_mem entries may be misaligned on macos. */
701701
char *gr_mem;
702-
memcpy(&gr_mem, &g->gr_mem[count], sizeof(char *));
702+
char *entry = (char *)g->gr_mem + (count * sizeof (char *));
703+
memcpy(&gr_mem, entry, sizeof(char *));
703704
if (!gr_mem) {
704705
break;
705706
}

0 commit comments

Comments
 (0)