Skip to content

Commit e68396c

Browse files
authored
Prevent use after stack scope in stream strerr code (#20040)
1 parent 3764410 commit e68396c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main/streams/streams.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ static void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const
155155
{
156156
char *tmp;
157157
char *msg;
158+
char errstr[256];
158159
int free_msg = 0;
159160

160161
if (EG(exception)) {
@@ -204,7 +205,6 @@ static void php_stream_display_wrapper_errors(php_stream_wrapper *wrapper, const
204205
free_msg = 1;
205206
} else {
206207
if (wrapper == &php_plain_files_wrapper) {
207-
char errstr[256];
208208
msg = php_socket_strerror_s(errno, errstr, sizeof(errstr));
209209
} else {
210210
msg = "operation failed";

0 commit comments

Comments
 (0)