aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_codec.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-05-29 18:40:19 +0200
committerAnders Svensson <[email protected]>2013-05-29 18:40:19 +0200
commitaecb2d0c041d43659f57235fe6b14478663e6444 (patch)
tree3981d03c97d8a408d9c146c263c8c732efbae594 /lib/diameter/src/base/diameter_codec.erl
parent048a67e6f34df0180bc8d2d0aba7f3b36d234a21 (diff)
parenta732bb3496cf24e62b607293de7c5ae49b3891ce (diff)
downloadotp-aecb2d0c041d43659f57235fe6b14478663e6444.tar.gz
otp-aecb2d0c041d43659f57235fe6b14478663e6444.tar.bz2
otp-aecb2d0c041d43659f57235fe6b14478663e6444.zip
Merge branch 'anders/diameter/avp_length_failure/OTP-11026' into maint
* anders/diameter/avp_length_failure/OTP-11026: Fix decode failure when AVP Length < 8
Diffstat (limited to 'lib/diameter/src/base/diameter_codec.erl')
-rw-r--r--lib/diameter/src/base/diameter_codec.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/diameter/src/base/diameter_codec.erl b/lib/diameter/src/base/diameter_codec.erl
index e446a0209c..09b99b2cae 100644
--- a/lib/diameter/src/base/diameter_codec.erl
+++ b/lib/diameter/src/base/diameter_codec.erl
@@ -427,6 +427,8 @@ split_avp(Bin) ->
<<Code:32, Flags:1/binary, Length:24, Rest/bitstring>>
= Bin,
+ 8 =< Length orelse ?THROW(invalid_avp_length),
+
DataSize = Length - 8, % size(Code+Flags+Length) = 8 octets
PadSize = (4 - (DataSize rem 4)) rem 4,