From: Ilia Alshanetsky Date: Sun, 31 Jan 2010 18:06:29 +0000 (+0000) Subject: Fixed a possible open_basedir/safe_mode bypass in session extension identified by... X-Git-Tag: php-5.4.0alpha1~191^2~2007 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bf62c33af160ed699af938ef10320ff95ac4a02;p=php Fixed a possible open_basedir/safe_mode bypass in session extension identified by Grzegorz Stachowiak. --- diff --git a/ext/session/session.c b/ext/session/session.c index cd53cf1ac6..2004b2de13 100644 --- a/ext/session/session.c +++ b/ext/session/session.c @@ -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; }