1
0
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:
Jakub Zelenka
2025-10-02 19:20:49 +02:00
committed by GitHub
parent 37644106ef
commit e68396cb39

View File

@@ -155,6 +155,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)) {
@@ -204,7 +205,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";