File tree 2 files changed +16
-1
lines changed 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,10 @@ PHP NEWS
88
88
. Fixed bug #61184 (Phar::webPhar() generates headers with trailing NUL
89
89
bytes). (Nikita Popov)
90
90
91
+ - Readline:
92
+ . Add open_basedir checks to readline_write_history and readline_read_history.
93
+ (Rasmus, reported by Mateusz Goik)
94
+
91
95
- Reflection:
92
96
. Fixed bug #60968 (Late static binding doesn't work with
93
97
ReflectionMethod::invokeArgs()). (Laruence)
Original file line number Diff line number Diff line change @@ -85,20 +85,31 @@ PHP_FUNCTION(readlink)
85
85
PHP_FUNCTION (linkinfo )
86
86
{
87
87
char * link ;
88
- int link_len ;
88
+ char * dirname ;
89
+ int link_len , dir_len ;
89
90
struct stat sb ;
90
91
int ret ;
91
92
92
93
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC , "p" , & link , & link_len ) == FAILURE ) {
93
94
return ;
94
95
}
95
96
97
+ dirname = estrndup (link , link_len );
98
+ dir_len = php_dirname (dirname , link_len );
99
+
100
+ if (php_check_open_basedir (dirname TSRMLS_CC )) {
101
+ efree (dirname );
102
+ RETURN_FALSE ;
103
+ }
104
+
96
105
ret = VCWD_LSTAT (link , & sb );
97
106
if (ret == -1 ) {
98
107
php_error_docref (NULL TSRMLS_CC , E_WARNING , "%s ", strerror (errno ));
108
+ efree (dirname );
99
109
RETURN_LONG (-1L );
100
110
}
101
111
112
+ efree (dirname );
102
113
RETURN_LONG ((long ) sb .st_dev );
103
114
}
104
115
/* }}} */
You can’t perform that action at this time.
0 commit comments