Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.2

Bug #7714 End of file marker not set in stream_read
Submitted: 2006-05-24 11:36 UTC
From: clef at gmx dot de Assigned: hholzgra
Status: Closed Package: HTTP_WebDAV_Client (version 0.9.7)
PHP Version: 4.4.2 OS: Win XP
Roadmaps: (Not assigned)    
Subscription  


 [2006-05-24 11:36 UTC] clef at gmx dot de (Hendrik)
Description: ------------ When reading a file in a while loop, as shown in the script, it is asumed that the end of file marker is retrieved. Yet, this is not the case leading to a buffer overflow. Due to line 265 in the Stream.php. The HTTP Request returns 416 when reading beyond the end of the file. The return value ($data) is cleaned, though the $len value isn't set to 0. This is crucial for line 275 where the end of file marker is set. It is not set by cleaning $data which contains the server message, because the $len value is retrieved before the switch operation. Possible solutions: - set the $len value to 0 when setting $data to "" - retrieve the length of $data after the switch Test script: --------------- if ($fp = fopen("webdav://wampp:xampp@localhost/webdav/webdav.txt", "r")) { while (!feof($fp)) { $buffer .= fread($fp, 1024); } echo $buffer; }

Comments

 [2006-07-08 16:07 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!