From fe5c1cc48fa493364537c033335f0c04aef62213 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 25 Feb 2014 16:25:45 +0400 Subject: [PATCH] Fixed crach because of dereferencing of NULL pointer --- ext/standard/exec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 7c440bf791..fddf580508 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -460,7 +460,7 @@ PHP_FUNCTION(shell_exec) ret = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0); php_stream_close(stream); - if (ret->len > 0) { + if (ret && ret->len > 0) { RETVAL_STR(ret); } } -- 2.40.0