iliaa           Tue Oct  5 19:53:14 2004 EDT

  Modified files:              (Branch: PHP_5_0)
    /php-src    NEWS 
    /php-src/ext/ftp    ftp.c 
  Log:
  MFH: Fixed bug #30027 (Possible crash inside ftp_get()).
  
  
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.92&r2=1.1760.2.93&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1760.2.92 php-src/NEWS:1.1760.2.93
--- php-src/NEWS:1.1760.2.92    Tue Oct  5 14:45:01 2004
+++ php-src/NEWS        Tue Oct  5 19:53:14 2004
@@ -13,6 +13,8 @@
 - Fixed bug #30147 (OO sqlite_fetch_object did not reset error handler). (Wez)
 - Fixed bug #30133 (get_current_user() crashes on Windows). (Edin)
 - Fixed bug #30057 (did not detect IPV6 on FreeBSD 4.1). (Wez)
+- Fixed bug #30027 (Possible crash inside ftp_get()).
+  (cfield at affinitysolutions dot com)
 - Fixed bug #27798 (private / protected variables not exposed by 
   get_object_vars() inside class). (Marcus)
 
http://cvs.php.net/diff.php/php-src/ext/ftp/ftp.c?r1=1.103.2.1&r2=1.103.2.2&ty=u
Index: php-src/ext/ftp/ftp.c
diff -u php-src/ext/ftp/ftp.c:1.103.2.1 php-src/ext/ftp/ftp.c:1.103.2.2
--- php-src/ext/ftp/ftp.c:1.103.2.1     Tue Sep 28 05:13:35 2004
+++ php-src/ext/ftp/ftp.c       Tue Oct  5 19:53:14 2004
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: ftp.c,v 1.103.2.1 2004/09/28 09:13:35 wez Exp $ */
+/* $Id: ftp.c,v 1.103.2.2 2004/10/05 23:53:14 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -864,12 +864,12 @@
                                ptr = s;
                        }
 #else
-                       while ((s = memchr(ptr, '\r', (e - ptr)))) {
+                       while (e > ptr && (s = memchr(ptr, '\r', (e - ptr)))) {
                                php_stream_write(outstream, ptr, (s - ptr));
                                if (*(s + 1) == '\n') {
                                        s++;
+                                       php_stream_putc(outstream, '\n');
                                }
-                               php_stream_putc(outstream, '\n');
                                ptr = s + 1;
                        }
 #endif

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

Reply via email to