Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug GH-11246 cli/get_set_process_title initialisation failure on MacOS #11247

Closed
wants to merge 3 commits into from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Expand Up @@ -10,6 +10,10 @@ PHP NEWS
. Fixed bug GH-11222 (foreach by-ref may jump over keys during a rehash).
(Bob)

- CLI:
. Fixed bug GH-11246 (cli/get_set_process_title fails
on MacOS). (James Lucas)

- Exif:
. Fixed bug GH-10834 (exif_read_data() cannot read smaller stream wrapper
chunk sizes). (nielsdos)
Expand Down
14 changes: 7 additions & 7 deletions sapi/cli/ps_title.c
Expand Up @@ -167,19 +167,19 @@ char** save_ps_args(int argc, char** argv)
end_of_area = argv[i] + strlen(argv[i]);
}

if (non_contiguous_area != 0)
goto clobber_error;

/*
* check for contiguous environ strings following argv
*/
for (i = 0; (non_contiguous_area == 0) && (environ[i] != NULL); i++)
for (i = 0; environ[i] != NULL; i++)
{
if (end_of_area + 1 != environ[i])
non_contiguous_area = 1;
end_of_area = environ[i] + strlen(environ[i]);
if (end_of_area + 1 == environ[i]) {
end_of_area = environ[i] + strlen(environ[i]);
}
}

if (non_contiguous_area != 0)
goto clobber_error;

ps_buffer = argv[0];
ps_buffer_size = end_of_area - argv[0];

Expand Down