helly           Wed Jan 10 20:12:14 2007 UTC

  Modified files:              
    /php-src/ext/standard       file.c 
  Log:
  - Fix mem access
  
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.482&r2=1.483&diff_format=u
Index: php-src/ext/standard/file.c
diff -u php-src/ext/standard/file.c:1.482 php-src/ext/standard/file.c:1.483
--- php-src/ext/standard/file.c:1.482   Mon Jan  1 09:29:31 2007
+++ php-src/ext/standard/file.c Wed Jan 10 20:12:14 2007
@@ -21,7 +21,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: file.c,v 1.482 2007/01/01 09:29:31 sebastian Exp $ */
+/* $Id: file.c,v 1.483 2007/01/10 20:12:14 helly Exp $ */
 
 /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
 
@@ -2425,6 +2425,7 @@
                                        state = PHP_FGETCSV_READY;
                                        field_start = field_end = NULL;
                                        p += delimiter_len;
+                                       if (p >= e) break;
                                        goto ready_state;
                                }
 
@@ -2446,6 +2447,7 @@
                                        state = PHP_FGETCSV_READY;
                                        field_start = field_end = NULL;
                                        p += delimiter_len;
+                                       if (p >= e) break;
                                        goto ready_state;
                                }
 
@@ -2546,6 +2548,7 @@
                                                memmove(p, p + enclosure_len, 
(e - p) - enclosure_len);
                                                e -= enclosure_len;
                                                p += enclosure_len;
+                                               if (p >= e) break;
                                                goto with_enc;
                                        } else {
                                                /* Genuine end enclosure, 
switch state */
@@ -2561,6 +2564,7 @@
                                        p += escape_len + 1;
 
                                        /* Reprocess for ending enclosures */
+                                       if (p >= e) break;
                                        goto with_enc;
                                }
 

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

Reply via email to