diff --git a/lib/ext/Syncroton/Server.php b/lib/ext/Syncroton/Server.php --- a/lib/ext/Syncroton/Server.php +++ b/lib/ext/Syncroton/Server.php @@ -346,6 +346,11 @@ $tag = ord(fread($stream, 1)); $length = ord(fread($stream, 1)); + // If the stream is at the end we'll get a 0-length + if (!$length) { + continue; + } + switch ($tag) { case self::PARAMETER_ATTACHMENTNAME: $unpacked = unpack('A' . $length . 'string', fread($stream, $length));