Skip to content

Commit e98fd75

Browse files
Add a check on the length of the datatype
1 parent fd9d92a commit e98fd75

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

adafruit_gps.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,8 @@ def update(self):
248248
if self.debug:
249249
print(sentence)
250250
data_type, args = sentence
251+
if len(data_type) < 5:
252+
return False
251253
data_type = bytes(data_type.upper(), "ascii")
252254
(talker, sentence_type) = _parse_talker(data_type)
253255

0 commit comments

Comments
 (0)