Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix padding calculation

  • Loading branch information...
commit f2244e54ed801475efb6d9b16975cf2bc8853657 1 parent bdde4b5
@ates ates authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/pkt.erl
View
4 src/pkt.erl
@@ -365,10 +365,10 @@ sctp_decode_chunks(<<>>, Acc) ->
sctp_decode_chunks(<<Type:8, Flags:8, Length:16, Rest/binary>>, Acc) ->
L = case Length rem 4 of
0 -> Length - 4;
- Pad -> Length + Pad - 4
+ Pad -> Length + (4 - Pad) - 4
end,
<<Payload:L/binary-unit:8, Tail/binary>> = Rest,
- sctp_decode_chunks(Tail, [sctp_chunk(Type, Flags, Length, Payload) | Acc]).
+ sctp_decode_chunks(Tail, [sctp_chunk(Type, Flags, L, Payload) | Acc]).
sctp_chunk(Ctype, Cflags, Clen, Payload) ->
#sctp_chunk{type=Ctype, flags=Cflags, len = Clen-4,
Please sign in to comment.
Something went wrong with that request. Please try again.