tony2001                Sat Dec 29 10:52:51 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /php-src/main/streams       streams.c 
  Log:
  correct fix for bug #43522
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1042&r2=1.2027.2.547.2.1043&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.1042 php-src/NEWS:1.2027.2.547.2.1043
--- php-src/NEWS:1.2027.2.547.2.1042    Fri Dec 28 13:38:19 2007
+++ php-src/NEWS        Sat Dec 29 10:52:51 2007
@@ -14,7 +14,7 @@
   function). (Ilia)
 - Fixed bug #43533 (escapeshellarg('') returns null). (Ilia)
 - Fixed bug #43522 (stream_get_line() eats additional characters). (Felipe,
-  Ilia)
+  Ilia, Tony)
 - Fixed bug #43495 (array_merge_recursive() crashes with recursive arrays).
   (Ilia)
 - Fixed bug #43493 (pdo_pgsql does not send username on connect when password
http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.19&r2=1.82.2.6.2.20&diff_format=u
Index: php-src/main/streams/streams.c
diff -u php-src/main/streams/streams.c:1.82.2.6.2.19 
php-src/main/streams/streams.c:1.82.2.6.2.20
--- php-src/main/streams/streams.c:1.82.2.6.2.19        Mon Dec 10 14:18:02 2007
+++ php-src/main/streams/streams.c      Sat Dec 29 10:52:51 2007
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: streams.c,v 1.82.2.6.2.19 2007/12/10 14:18:02 iliaa Exp $ */
+/* $Id: streams.c,v 1.82.2.6.2.20 2007/12/29 10:52:51 tony2001 Exp $ */
 
 #define _GNU_SOURCE
 #include "php.h"
@@ -855,10 +855,17 @@
        if (delim_len == 0 || !delim) {
                toread = maxlen;
        } else {
+               size_t seek_len;
+
+               seek_len = stream->writepos - stream->readpos;
+               if (seek_len > maxlen) {
+                       seek_len = maxlen;
+               }
+
                if (delim_len == 1) {
-                       e = memchr(stream->readbuf + stream->readpos, *delim, 
maxlen);
+                       e = memchr(stream->readbuf + stream->readpos, *delim, 
seek_len);
                } else {
-                       e = php_memnstr(stream->readbuf + stream->readpos, 
delim, delim_len, (stream->readbuf + stream->readpos + maxlen));
+                       e = php_memnstr(stream->readbuf + stream->readpos, 
delim, delim_len, (stream->readbuf + stream->readpos + seek_len));
                }
 
                if (!e) {

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

Reply via email to