From 12ececed822355914b6cda981db4984b41b784cc Mon Sep 17 00:00:00 2001 From: Alec Delaney Date: Thu, 17 Feb 2022 21:02:43 -0500 Subject: [PATCH] Fix packet length check in _update() Fixes #8 by submitting the fixed proposed by @tannewt in the issue --- adafruit_ble_apple_media.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_ble_apple_media.py b/adafruit_ble_apple_media.py index 20f1c51..937778a 100644 --- a/adafruit_ble_apple_media.py +++ b/adafruit_ble_apple_media.py @@ -95,7 +95,7 @@ def _update(obj): obj._buffer = bytearray(128) length_read = obj._entity_update.readinto(obj._buffer) if length_read > 0: - if length_read < 4: + if length_read < 3: raise RuntimeError("packet too short") # Even though flags is currently unused, if it were removed, it would cause there to be # too many values to unpack which would raise a ValueError