Skip to content

Commit

Permalink
[parser] INP: workaround for empty trailer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sec42 committed Apr 28, 2024
1 parent 04cd9fa commit 17755df
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bitsparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,8 @@ def __init__(self,imsg):
# Pkt v1
self.v1trail=trailer[:8]
self.cs_v1=trailer[8:]
if self.cs_v1 == '':
self.cs_v1='0'

self.the_crc_v1=np_crc16(bytes( [int(x,2) for x in slice(
hdr[-1][-8:]+
Expand All @@ -867,6 +869,8 @@ def __init__(self,imsg):

self.cs_v2=self.trailer[:16]
self.v2trail=self.trailer[16:]
if self.cs_v2 == '':
self.cs_v2='0'

self.the_crc_v2=np_crc16(bytes([int(x,2) for x in slice(
hdr[-1][-8:]+
Expand Down

0 comments on commit 17755df

Please sign in to comment.