Fix error

This commit is contained in:
Thomas Arts 2019-06-19 17:41:22 +02:00
parent cb83224c60
commit 1fda6912da

View File

@ -373,6 +373,7 @@ deserialize2(<<?POS_BITS, Rest/binary>>) ->
{?FATE_BITS(Bint), Rest2}; {?FATE_BITS(Bint), Rest2};
deserialize2(<<?LONG_STRING, Rest/binary>>) -> deserialize2(<<?LONG_STRING, Rest/binary>>) ->
{S, Rest2} = deserialize_one(Rest), {S, Rest2} = deserialize_one(Rest),
true = is_integer(S) andalso S >= 0,
Size = S + ?SHORT_STRING_SIZE, Size = S + ?SHORT_STRING_SIZE,
String = binary:part(Rest2, 0, Size), String = binary:part(Rest2, 0, Size),
Rest3 = binary:part(Rest2, byte_size(Rest2), - (byte_size(Rest2) - Size)), Rest3 = binary:part(Rest2, byte_size(Rest2), - (byte_size(Rest2) - Size)),