mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix buffer-overflow in open_basedir()
This commit is contained in:
parent
2b9d2bcee7
commit
a7f91e37de
2 changed files with 2 additions and 1 deletions
|
@ -10,6 +10,7 @@ $tmpDir = $originalDir . '/gh10469_tmp';
|
|||
chdir($tmpDir);
|
||||
ini_set('open_basedir', ini_get('open_basedir') . ':./..');
|
||||
ini_set('open_basedir', ini_get('open_basedir') . ':./../');
|
||||
ini_set('open_basedir', ini_get('open_basedir') . ':/a/');
|
||||
|
||||
chdir($originalDir);
|
||||
var_dump(ini_get('open_basedir'));
|
||||
|
|
|
@ -103,7 +103,7 @@ PHPAPI ZEND_INI_MH(OnUpdateBaseDir)
|
|||
}
|
||||
/* Don't allow paths with a parent dir component (..) to be set at runtime */
|
||||
char *substr_pos = ptr;
|
||||
while (true) {
|
||||
while (*substr_pos) {
|
||||
// Check if we have a .. path component
|
||||
if (substr_pos[0] == '.'
|
||||
&& substr_pos[1] == '.'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue