]> granicus.if.org Git - php/commitdiff
Fixed crach because of dereferencing of NULL pointer
authorDmitry Stogov <dmitry@zend.com>
Tue, 25 Feb 2014 12:25:45 +0000 (16:25 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 25 Feb 2014 12:25:45 +0000 (16:25 +0400)
ext/standard/exec.c

index 7c440bf79192cfaece98a20accfa0e5e9d166aa0..fddf580508590b7cdc11e2f8c6b147b894b0e453 100644 (file)
@@ -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);
        }
 }