Skip to content

Commit

Permalink
Fixed #40 - unpack not having enough input
Browse files Browse the repository at this point in the history
  • Loading branch information
bwoebi authored Sep 21, 2017
1 parent c784784 commit a88b51f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -987,8 +987,8 @@ private function parseCompression() {
$buf = "";

while (true) {
while (\strlen($buf) < 4) {
$buf .= (yield $inflated);
while (\strlen($buf) < 7) {
$buf .= yield $inflated;
$inflated = "";
}

Expand All @@ -1000,7 +1000,7 @@ private function parseCompression() {

if ($size > 0) {
while (\strlen($buf) < $size) {
$buf .= (yield $inflated);
$buf .= yield $inflated;
$inflated = "";
}

Expand Down Expand Up @@ -1028,7 +1028,7 @@ private function parseMysql(): \Generator {

do {
while (\strlen($buf) < 4) {
$buf .= (yield $parsed);
$buf .= yield $parsed;
$parsed = [];
}

Expand All @@ -1037,7 +1037,7 @@ private function parseMysql(): \Generator {
$buf = substr($buf, 4);

while (\strlen($buf) < ($len & 0xffffff)) {
$buf .= (yield $parsed);
$buf .= yield $parsed;
$parsed = [];
}

Expand Down

0 comments on commit a88b51f

Please sign in to comment.