From 389da4e655c512756dddd2b9e2967565d380113d Mon Sep 17 00:00:00 2001 From: Christopher Vagnetoft Date: Fri, 3 Apr 2026 01:42:41 +0200 Subject: [PATCH] Bugfix Json consumer logic --- src/Json/JsonProtocol.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Json/JsonProtocol.php b/src/Json/JsonProtocol.php index fafa32b..b865ae9 100644 --- a/src/Json/JsonProtocol.php +++ b/src/Json/JsonProtocol.php @@ -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;