Fixed a possible open_basedir/safe_mode bypass in session extension identified by Grzegorz Stachowiak.

This commit is contained in:
Ilia Alshanetsky 2010-01-31 18:06:29 +00:00
parent 981faa6754
commit 7bf62c33af

View File

@ -563,8 +563,13 @@ static PHP_INI_MH(OnUpdateSaveDir) /* {{{ */
return FAILURE;
}
if ((p = zend_memrchr(new_value, ';', new_value_length))) {
/* we do not use zend_memrchr() since path can contain ; itself */
if ((p = strchr(new_value, ';'))) {
char *p2;
p++;
if ((p2 = strchr(p, ';'))) {
p = p2 + 1;
}
} else {
p = new_value;
}