Skip to content

Commit ad2e45c

Browse files
authored
Merge pull request #1250 from fazledyn-or/Fix_Inappropriate_Logic
FIX: Updated expression to fix logical short circuit
2 parents 1f4d057 + f5daf65 commit ad2e45c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

custom_components/ble_monitor/ble_parser/hormann.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def parse_hormann(self, data, source_mac, rssi):
1818

1919
while data_size > 1:
2020
packet_size = data[packet_start] + 1
21-
if packet_size > 1 and packet_size <= packet_size:
21+
if packet_size > 1 and packet_size <= data_size:
2222
packet = data[packet_start:packet_start + packet_size]
2323
packet_type = packet[1]
2424

custom_components/ble_monitor/ble_parser/teltonika.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def parse_teltonika(self, data, complete_local_name, source_mac, rssi):
3333
data_size = len(data)
3434
while data_size > 1:
3535
packet_size = data[packet_start] + 1
36-
if packet_size > 1 and packet_size <= packet_size:
36+
if packet_size > 1 and packet_size <= data_size:
3737
packet = data[packet_start:packet_start + packet_size]
3838
packet_type = packet[1]
3939
if packet_type == 0x16 and packet_size > 4:

0 commit comments

Comments
 (0)