diff options
author | Pierre Joye <pajoye@php.net> | 2010-11-18 15:22:22 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2010-11-18 15:22:22 +0000 |
commit | ce96fd6b0761d98353761bf78d5bfb55291179fd (patch) | |
tree | 0b66c858477f5ac7472bf35b842f89cdf4dce151 /ext/imap | |
parent | 75631ab8ac231f141286428fd871ad31f2d71588 (diff) | |
download | php-git-ce96fd6b0761d98353761bf78d5bfb55291179fd.tar.gz |
- fix #39863, do not accept paths with NULL in them. See http://news.php.net/php.internals/50191, trunk will have the patch later (adding a macro and/or changing (some) APIs. Patch by Rasmus
Diffstat (limited to 'ext/imap')
-rw-r--r-- | ext/imap/php_imap.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/ext/imap/php_imap.c b/ext/imap/php_imap.c index 408dd8b875..866c61e703 100644 --- a/ext/imap/php_imap.c +++ b/ext/imap/php_imap.c @@ -1218,10 +1218,14 @@ static void php_imap_do_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) } /* local filename, need to perform open_basedir and safe_mode checks */ - if (mailbox[0] != '{' && - (php_check_open_basedir(mailbox TSRMLS_CC) || - (PG(safe_mode) && !php_checkuid(mailbox, NULL, CHECKUID_CHECK_FILE_AND_DIR)))) { - RETURN_FALSE; + if (mailbox[0] != '{') { + if (strlen(mailbox) != mailbox_len) { + RETURN_FALSE; + } + if (php_check_open_basedir(mailbox TSRMLS_CC) || + (PG(safe_mode) && !php_checkuid(mailbox, NULL, CHECKUID_CHECK_FILE_AND_DIR))) { + RETURN_FALSE; + } } IMAPG(imap_user) = estrndup(user, user_len); |