Skip to content

Commit

Permalink
[mms] Fix possible infinite loop when reading from a combined stream.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Jan 28, 2015
1 parent ea73894 commit 6bbddc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Expand Up @@ -164,9 +164,13 @@ public function stream_read($count)
}

$out = '';
$tmp = &$this->_data[$this->_datapos];

while ($count) {
$tmp = &$this->_data[$this->_datapos];
if (!is_resource($tmp['fp'])) {
return false;
}

$curr_read = min($count, $tmp['l'] - $tmp['p']);
$out .= fread($tmp['fp'], $curr_read);
$count -= $curr_read;
Expand Down
4 changes: 2 additions & 2 deletions framework/Stream_Wrapper/package.xml
Expand Up @@ -27,7 +27,7 @@
</stability>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [mms] Fix possible infinite loop when reading from a combined stream.
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down Expand Up @@ -273,7 +273,7 @@
<date>2015-01-09</date>
<license uri="http://www.horde.org/licenses/bsd">BSD-2-Clause</license>
<notes>
*
* [mms] Fix possible infinite loop when reading from a combined stream.
</notes>
</release>
</changelog>
Expand Down

0 comments on commit 6bbddc3

Please sign in to comment.