Correct maximum length
This commit is contained in:
parent
7e4c3db915
commit
c7cea04aba
1 changed files with 2 additions and 2 deletions
|
@ -1519,11 +1519,11 @@ crc_check_slot(FullBin) ->
|
|||
PosBL:32/integer,
|
||||
CRC32H:32/integer,
|
||||
Rest/binary>> = FullBin,
|
||||
PosBL0 = min(PosBL, byte_size(FullBin) - 4),
|
||||
PosBL0 = min(PosBL, byte_size(FullBin) - 3),
|
||||
% If the position has been bit-flipped to beyond the maximum paossible
|
||||
% length, use the maximum possible length
|
||||
<<Header:PosBL0/binary, Blocks/binary>> = Rest,
|
||||
case {hmac(Header), hmac(PosBL)} of
|
||||
case {hmac(Header), hmac(PosBL0)} of
|
||||
{CRC32H, CRC32PBL} ->
|
||||
{Header, Blocks};
|
||||
_ ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue