bjori           Sat May 12 16:06:07 2007 UTC

  Modified files:              
    /php-src/main       php_ini.c 
  Log:
  Fixed bug#41361 (shell_exec() does not find binaries)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.151&r2=1.152&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.151 php-src/main/php_ini.c:1.152
--- php-src/main/php_ini.c:1.151        Thu May 10 19:51:19 2007
+++ php-src/main/php_ini.c      Sat May 12 16:06:07 2007
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_ini.c,v 1.151 2007/05/10 19:51:19 bjori Exp $ */
+/* $Id: php_ini.c,v 1.152 2007/05/12 16:06:07 bjori Exp $ */
 
 #include "php.h"
 #include "ext/standard/info.h"
@@ -352,12 +352,15 @@
                if (sapi_module.executable_location) {
                        binary_location = (char *)emalloc(PATH_MAX);
                        if (!strchr(sapi_module.executable_location, '/')) {
-                               char *path;
+                               char *envpath, *path;
                                int found = 0;
 
-                               if ((path = getenv("PATH")) != NULL) {
+                               if ((envpath = getenv("PATH")) != NULL) {
                                        char *search_dir, 
search_path[MAXPATHLEN];
                                        char *last;
+                                       int pathlen = strlen(envpath) + 1;
+                                       path = malloc(pathlen);
+                                       memcpy(path, envpath, pathlen);
 
                                        search_dir = php_strtok_r(path, ":", 
&last);
                                        while (search_dir) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to