]> granicus.if.org Git - php/commitdiff
Fixed bug data->fd not set to -1 for open_basedir failure.
authorYasuo Ohgaki <yohgaki@php.net>
Thu, 30 Jan 2014 05:15:29 +0000 (14:15 +0900)
committerYasuo Ohgaki <yohgaki@php.net>
Thu, 30 Jan 2014 05:15:29 +0000 (14:15 +0900)
ext/session/mod_files.c

index 615db85471775ce66246bdb170da23dcfce3e541..86a2235845148193732452589f92b8334abb7006 100644 (file)
@@ -176,10 +176,12 @@ static void ps_files_open(ps_files *data, const char *key TSRMLS_DC)
 
                                if (fstat(data->fd, &sbuf)) {
                                        close(data->fd);
+                                       data->fd = -1;
                                        return;
                                }
                                if (S_ISLNK(sbuf.st_mode) && php_check_open_basedir(buf TSRMLS_CC)) {
                                        close(data->fd);
+                                       data->fd = -1;
                                        return;
                                }
                        }