Commit 93d5b1c0 authored by Anton Smirnov's avatar Anton Smirnov
Browse files

That was more than exponentially

parent af0452ca
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -100,7 +100,7 @@ class Decoder
    private function readInteger(string $delimiter)
    {
        $pos = ftell($this->stream);
        $readLength = 64;
        $readLength = 32; // More than enough for 64 bit int (19 digits + minus + delimiter)

        do {
            fseek($this->stream, $pos, SEEK_SET);
@@ -116,7 +116,7 @@ class Decoder
            }

            fread($this->stream, 1); // trigger feof
            $readLength *= $readLength; // grow exponentially
            $readLength *= 32; // grow exponentially
        } while (!feof($this->stream) && $readLength < PHP_INT_MAX);

        return false;