com php-src: add error check to sysconf call: ext/standard/exec.c

From: Date: Tue, 02 Feb 2016 13:33:56 +0000
Subject: com php-src: add error check to sysconf call: ext/standard/exec.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-90904@lists.php.net to get a copy of this message
Commit: 523bb2473470242c9b167584247bf7c6b4bcb8d5 Author: Anatol Belski <ab@php.net> Tue, 2 Feb 2016 14:19:10 +0100 Committer: Julien Pauli <jpauli@php.net> Tue, 2 Feb 2016 14:33:56 +0100 Parents: 795a3bd4ab657f43372b17c564fc407433d9d893 Branches: PHP-5.5.32 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=523bb2473470242c9b167584247bf7c6b4bcb8d5 Log: add error check to sysconf call Changed paths: M ext/standard/exec.c Diff: diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 461bef4..329066e 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -50,6 +50,10 @@ #include <unistd.h> #endif +#if HAVE_LIMITS_H +#include <limits.h> +#endif + #ifdef PHP_WIN32 # include "win32/php_stdint.h" #else @@ -67,6 +71,13 @@ PHP_MINIT_FUNCTION(exec) { #ifdef _SC_ARG_MAX cmd_max_len = sysconf(_SC_ARG_MAX); + if (-1 == cmd_max_len) { +#ifdef _POSIX_ARG_MAX + cmd_max_len = _POSIX_ARG_MAX; +#else + cmd_max_len = 4096; +#endif + } #elif defined(ARG_MAX) cmd_max_len = ARG_MAX; #elif defined(PHP_WIN32)

« previous php.cvs (#90904) next »