mirror of
https://github.com/php/php-src.git
synced 2024-09-21 09:57:23 +00:00
Fix bug GH-11246 cli/get_set_process_title
Fail to clobber_error only when the argv is a non-contiguous area Don't increment the end_of_error if a non-contiguous area is encountered in environ Closes GH-11247
This commit is contained in:
parent
c50172e812
commit
c6ae7a55b7
4
NEWS
4
NEWS
@ -2,6 +2,10 @@ PHP NEWS
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
?? ??? ????, PHP 8.1.21
|
||||
|
||||
- CLI:
|
||||
. Fixed bug GH-11246 (cli/get_set_process_title fails on MacOS).
|
||||
(James Lucas)
|
||||
|
||||
- Core:
|
||||
. Fixed build for the riscv64 architecture/GCC 12. (Daniil Gentili)
|
||||
|
||||
|
@ -167,19 +167,20 @@ 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];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user