sas             Sat Sep 20 12:09:43 2003 EDT

  Modified files:              (Branch: PHP_4_3)
    /php-src/ext/standard       string.c 
  Log:
  Avoid zero-length keys which result in a spinning process
  
  
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.333.2.33 
php-src/ext/standard/string.c:1.333.2.34
--- php-src/ext/standard/string.c:1.333.2.33    Sat Jul 12 05:33:58 2003
+++ php-src/ext/standard/string.c       Sat Sep 20 12:09:41 2003
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: string.c,v 1.333.2.33 2003/07/12 09:33:58 moriyoshi Exp $ */
+/* $Id: string.c,v 1.333.2.34 2003/09/20 16:09:41 sas Exp $ */
 
 /* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
 
@@ -1551,7 +1551,7 @@
 
 /* {{{ php_chunk_split
  */
-static char *php_chunk_split(char *src, int srclen, char *end, int endlen,
+static PHP_ATTRIBUTE_MALLOC char *php_chunk_split(char *src, int srclen, char *end, 
int endlen,
                                                         int chunklen, int *destlen)
 {
        char *dest;
@@ -1940,6 +1940,9 @@
                switch (zend_hash_get_current_key_ex(hash, &string_key, 
&string_key_len, &num_key, 0, &hpos)) {
                case HASH_KEY_IS_STRING:
                        len = string_key_len-1;
+                       if (len < 1) {
+                               RETURN_FALSE;
+                       }
                        if (len > maxlen) maxlen = len;
                        if (len < minlen) minlen = len;
                        break; 

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

Reply via email to