Hi all,

when I was looking for source of problem with message forwarding I
found these two things:

1/ there is function iil_ReadLine($fp, $size) but $size isn't used
there. IMHO :) it should be used for fgets instead fixed value, but
I'm realy realy not sure. Ryo, can you say? Patch with my opinion :)
is attached.

2/ in function iil_C_HandlePartBody on line 1818 there is 

if ($len > $remaining) substr($line, 0, $remaining);

But substr only return substring and do not directly modify $line,
so it should look like this:

if ($len > $remaining) $line = substr($line, 0, $remaining);

Patch is attached. This is BUG, but I never mention that it have
some bad impact :)

-- 
 .''`. Ondra 'Kepi' Kudlik
: :' : Debian GNU/Linux User
`. `'
  `-   http://www.nosoftwarepatents.com/cz/m/intro/index.html 

diff -Naur include/imap.inc 
/domains/igloonet.com/web/www/ilohatest/include/imap.inc
--- include/imap.inc    2005-10-10 04:35:23.000000000 +0200
+++ include/imap.inc.new   2005-10-29 18:13:14.000000000 +0200
@@ -1815,8 +1815,8 @@
                 $remaining = $bytes - $received;
                 $line = iil_ReadLine($fp, 1024);
                 $len = strlen($line);
-                if ($len > $remaining) substr($line, 0, $remaining);
+                if ($len > $remaining) $line = substr($line, 0, $remaining);
                 $received += strlen($line);
                 if ($mode==1) $result .= chop($line)."\n";
                 else if ($mode==2){ echo chop($line)."\n"; flush(); }
                 else if ($mode==3){ echo base64_decode($line); flush(); }

diff -Naur include/imap.inc 
/domains/igloonet.com/web/www/ilohatest/include/imap.inc
--- include/imap.inc    2005-10-10 04:35:23.000000000 +0200
+++ include/imap.inc.new   2005-10-29 18:13:14.000000000 +0200
@@ -99,7 +99,7 @@
        $line="";
        if ($fp){
                do{
-                       $buffer = fgets($fp, 2048);
+                       $buffer = fgets($fp, $size);
                        $line.=$buffer;
                }while($buffer[strlen($buffer)-1]!="\n");
        }

Attachment: signature.asc
Description: Digital signature

Reply via email to