Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10968 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75351 invoked by uid 1010); 8 Jul 2004 05:20:32 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 75325 invoked from network); 8 Jul 2004 05:20:31 -0000 Received: from unknown (HELO took.shire) (68.126.141.9) by pb1.pair.com with SMTP; 8 Jul 2004 05:20:31 -0000 Received: (qmail 37764 invoked by uid 1001); 8 Jul 2004 05:32:08 -0000 Date: Thu, 8 Jul 2004 05:32:08 +0000 To: internals@lists.php.net Message-ID: <20040708053208.GR99175@bagend.shire> Mail-Followup-To: internals@lists.php.net Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="7AUc2qLy4jB3hD7Z" Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: patch for bug #28999 From: curt@php.net (Curt Zirzow) --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline http://bugs.php.net/28999 It seems the behaviour of exec() and the array being returned changed when iliaa revamped a lot of code pre 4_3_2RC1, which caused the array being passed to always get initialized. So it does seem questionable if it should be refixed since this behaviour has been around for a while. Curt -- First, let me assure you that this is not one of those shady pyramid schemes you've been hearing about. No, sir. Our model is the trapezoid! --7AUc2qLy4jB3hD7Z Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="exec.patch" Index: exec.c =================================================================== RCS file: /repository/php-src/ext/standard/exec.c,v retrieving revision 1.110 diff -u -r1.110 exec.c --- exec.c 18 May 2004 13:43:24 -0000 1.110 +++ exec.c 8 Jul 2004 05:18:38 -0000 @@ -213,8 +213,10 @@ if (!ret_array) { ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC); } else { - zval_dtor(ret_array); - array_init(ret_array); + if (Z_TYPE_P(ret_array) != IS_ARRAY) { + pval_destructor(ret_array); + array_init(ret_array); + } ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC); } if (ret_code) { --7AUc2qLy4jB3hD7Z--