com php-src: Fix bug #69814 Enabling php_curl, php_mysq li, and php_openssl causes php-cgi to crash: Zend/zend_virtual_cwd.c

From: Date: Sat, 13 Jun 2015 16:45:27 +0000
Subject: com php-src: Fix bug #69814 Enabling php_curl, php_mysq li, and php_openssl causes php-cgi to crash: Zend/zend_virtual_cwd.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87247@lists.php.net to get a copy of this message
Commit: 6084844fb5b93d3712d5b1376ed99bfa6c51b637 Author: Anatol Belski <ab@php.net> Sat, 13 Jun 2015 18:44:56 +0200 Parents: 336cfac7f3b144855b76fdba569d36ba00ccac8c Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6084844fb5b93d3712d5b1376ed99bfa6c51b637 Log: Fix bug #69814 Enabling php_curl, php_mysqli, and php_openssl causes php-cgi to crash Bugs: https://bugs.php.net/69814 Changed paths: M Zend/zend_virtual_cwd.c Diff: diff --git a/Zend/zend_virtual_cwd.c b/Zend/zend_virtual_cwd.c index 330fff1..cc3fff4 100644 --- a/Zend/zend_virtual_cwd.c +++ b/Zend/zend_virtual_cwd.c @@ -553,6 +553,11 @@ CWD_API char *virtual_getcwd_ex(size_t *length) /* {{{ */ return retval; } #endif + if (!state->cwd) { + *length = 0; + return NULL; + } + *length = state->cwd_length; return estrdup(state->cwd); } @@ -574,6 +579,9 @@ CWD_API char *virtual_getcwd(char *buf, size_t size) /* {{{ */ errno = ERANGE; /* Is this OK? */ return NULL; } + if (!cwd) { + return NULL; + } memcpy(buf, cwd, length+1); efree(cwd); return buf;

« previous php.cvs (#87247) next »