mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Prevent use after stack scope in stream strerr code (#20040)
This commit is contained in:
@@ -154,6 +154,7 @@ static void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const
|
||||
{
|
||||
char *tmp;
|
||||
char *msg;
|
||||
char errstr[256];
|
||||
int free_msg = 0;
|
||||
|
||||
if (EG(exception)) {
|
||||
@@ -203,7 +204,6 @@ static void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const
|
||||
free_msg = 1;
|
||||
} else {
|
||||
if (wrapper == &php_plain_files_wrapper) {
|
||||
char errstr[256];
|
||||
msg = php_socket_strerror_s(errno, errstr, sizeof(errstr));
|
||||
} else {
|
||||
msg = "operation failed";
|
||||
|
||||
Reference in New Issue
Block a user