iliaa           Sat Feb 24 03:24:40 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/standard       proc_open.c 
  Log:
  strdup() can fail
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/proc_open.c?r1=1.36.2.1.2.12&r2=1.36.2.1.2.13&diff_format=u
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.36.2.1.2.12 
php-src/ext/standard/proc_open.c:1.36.2.1.2.13
--- php-src/ext/standard/proc_open.c:1.36.2.1.2.12      Sat Feb 24 02:17:27 2007
+++ php-src/ext/standard/proc_open.c    Sat Feb 24 03:24:40 2007
@@ -15,7 +15,7 @@
    | Author: Wez Furlong <[EMAIL PROTECTED]>                           |
    +----------------------------------------------------------------------+
  */
-/* $Id: proc_open.c,v 1.36.2.1.2.12 2007/02/24 02:17:27 helly Exp $ */
+/* $Id: proc_open.c,v 1.36.2.1.2.13 2007/02/24 03:24:40 iliaa Exp $ */
 
 #if 0 && (defined(__linux__) || defined(sun) || defined(__IRIX__))
 # define _BSD_SOURCE           /* linux wants this when XOPEN mode is on */
@@ -784,6 +784,9 @@
        channel.errfd = -1;
        /* Duplicate the command as processing downwards will modify it*/
        command_dup = strdup(command);
+       if (!command_dup) {
+               goto exit_fail;
+       }
        /* get a number of args */
        construct_argc_argv(command_dup, NULL, &command_num_args, NULL);
        child_argv = (char**) malloc((command_num_args + 1) * sizeof(char*));

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

Reply via email to