iliaa           Wed Dec  7 22:26:17 2005 EDT

  Modified files:              (Branch: PHP_4_4)
    /php-src    NEWS 
    /php-src/ext/standard       basic_functions.c 
  Log:
  MFH: Fixed bug #35594 (Multiple calls to getopt() may result in a crash).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.920.2.97&r2=1.1247.2.920.2.98&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.920.2.97 php-src/NEWS:1.1247.2.920.2.98
--- php-src/NEWS:1.1247.2.920.2.97      Wed Dec  7 22:01:35 2005
+++ php-src/NEWS        Wed Dec  7 22:26:16 2005
@@ -3,6 +3,8 @@
 ?? ??? 2005, Version 4.4.2
 - Prevent header injection by limiting each header to a single line. (Ilia)
 - Fixed possible XSS inside error reporting functionality. (Ilia)
+- Fixed bug #35594 (Multiple calls to getopt() may result in a crash).
+  (rabbitt at gmail dot com, Ilia)
 - Fixed bug #35536 (mysql_field_type() doesn't handle NEWDECIMAL). (Tony)
 - Fixed bug #35410 (wddx_deserialize() doesn't handle large ints as keys 
   properly). (Ilia)
http://cvs.php.net/diff.php/php-src/ext/standard/basic_functions.c?r1=1.543.2.51.2.4&r2=1.543.2.51.2.5&ty=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.543.2.51.2.4 
php-src/ext/standard/basic_functions.c:1.543.2.51.2.5
--- php-src/ext/standard/basic_functions.c:1.543.2.51.2.4       Wed Nov  2 
12:58:00 2005
+++ php-src/ext/standard/basic_functions.c      Wed Dec  7 22:26:16 2005
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.543.2.51.2.4 2005/11/02 17:58:00 iliaa Exp $ */
+/* $Id: basic_functions.c,v 1.543.2.51.2.5 2005/12/08 03:26:16 iliaa Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -1595,6 +1595,9 @@
        /* Disable getopt()'s error messages. */
        opterr = 0;
 
+       /* Force reinitialization of getopt() (via optind reset) on every call. 
*/
+       optind = 0;
+
        /* Invoke getopt(3) on the argument array. */
 #ifdef HARTMUT_0
        while ((o = getopt_long(argc, argv, options, longopts, &longindex)) != 
-1) {

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

Reply via email to