Skip to content

Commit f5e097d

Browse files
author
Yasuo Ohgaki
committed
Fixed bug data->fd not set to -1 for open_basedir failure.
1 parent d941ac5 commit f5e097d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/session/mod_files.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,12 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
176176

177177
if (fstat(data->fd, &sbuf)) {
178178
close(data->fd);
179+
data->fd = -1;
179180
return;
180181
}
181182
if (S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf TSRMLS_CC)) {
182183
close(data->fd);
184+
data->fd = -1;
183185
return;
184186
}
185187
}

0 commit comments

Comments
 (0)