Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ PHP NEWS
. Fixed bug GH-20732 (Phar::LoadPhar undefined behavior when reading fails).
(ndossche)

- POSIX:
. Fixed crash on posix groups to php array creation on macos.
(David Carlier)

- SPL:
. Fixed bug GH-20678 (resource created by GlobIterator crashes with fclose()).
(David Carlier)
Expand Down
3 changes: 2 additions & 1 deletion ext/posix/posix.c
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ int php_posix_group_to_array(struct group *g, zval *array_group) /* {{{ */
for (count = 0;; count++) {
/* gr_mem entries may be misaligned on macos. */
char *gr_mem;
memcpy(&gr_mem, &g->gr_mem[count], sizeof(char *));
char *entry = (char *)g->gr_mem + (count * sizeof (char *));
memcpy(&gr_mem, entry, sizeof(char *));
if (!gr_mem) {
break;
}
Expand Down
Loading