Bugfix Json consumer logic

This commit is contained in:
Christopher Vagnetoft
2026-04-03 01:42:41 +02:00
parent 62a1167055
commit 389da4e655

View File

@@ -91,6 +91,9 @@ class JsonProtocol implements ProtocolInterface
{
// check for $this->prependSizeBytes
if ($this->prependSizeBytes > 0) {
if (strlen($data) < $this->prependSizeBytes) {
return null;
}
$len = $this->unpackSizeBytes($data);
// if size is greater than data (i.e. incomplete)
if ($len > strlen($data) - $this->prependSizeBytes) return null;