com php-src: Fixed segfault: ext/standard/streamsfuncs.c

From: Date: Wed, 05 Mar 2014 03:44:51 +0000
Subject: com php-src: Fixed segfault: ext/standard/streamsfuncs.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77735@lists.php.net to get a copy of this message
Commit: 63a1b349240ddc69577ab1e52249d21e7647e3c9 Author: Xinchen Hui <laruence@gmail.com> Wed, 5 Mar 2014 11:44:51 +0800 Parents: 1c427513160eb88d5b73b2883c48eaf204ad20f4 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=63a1b349240ddc69577ab1e52249d21e7647e3c9 Log: Fixed segfault Changed paths: M ext/standard/streamsfuncs.c Diff: diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index 6933493..39c0d17 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -440,9 +440,11 @@ PHP_FUNCTION(stream_get_contents) } } - contents = php_stream_copy_to_mem(stream, maxlen, 0); - - RETURN_STR(contents); + if ((contents = php_stream_copy_to_mem(stream, maxlen, 0))) { + RETURN_STR(contents); + } else { + RETURN_EMPTY_STRING(); + } } /* }}} */

« previous php.cvs (#77735) next »