aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_message.erl
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-10-15 20:33:25 +0200
committerHans Nilsson <[email protected]>2014-10-16 15:21:09 +0200
commita4cd7efbbbf174ae283cfac60a8e5492e340e3a6 (patch)
treeebc48d4df688aadf16d7f4b1ae2f042e38d91fba /lib/ssh/src/ssh_message.erl
parent5d49d05c3604f764736b10cfb287818d4b41efda (diff)
downloadotp-a4cd7efbbbf174ae283cfac60a8e5492e340e3a6.tar.gz
otp-a4cd7efbbbf174ae283cfac60a8e5492e340e3a6.tar.bz2
otp-a4cd7efbbbf174ae283cfac60a8e5492e340e3a6.zip
ssh: Fix port scanner problems
Diffstat (limited to 'lib/ssh/src/ssh_message.erl')
-rw-r--r--lib/ssh/src/ssh_message.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh_message.erl b/lib/ssh/src/ssh_message.erl
index 891ccec24c..66e7717095 100644
--- a/lib/ssh/src/ssh_message.erl
+++ b/lib/ssh/src/ssh_message.erl
@@ -505,6 +505,11 @@ erl_boolean(1) ->
decode_kex_init(<<?BYTE(Bool), ?UINT32(X)>>, Acc, 0) ->
list_to_tuple(lists:reverse([X, erl_boolean(Bool) | Acc]));
+decode_kex_init(<<?BYTE(Bool)>>, Acc, 0) ->
+ %% The mandatory trailing UINT32 is missing. Assume the value it anyhow must have
+ %% See rfc 4253 7.1
+ X = 0,
+ list_to_tuple(lists:reverse([X, erl_boolean(Bool) | Acc]));
decode_kex_init(<<?UINT32(Len), Data:Len/binary, Rest/binary>>, Acc, N) ->
Names = string:tokens(unicode:characters_to_list(Data), ","),
decode_kex_init(Rest, [Names | Acc], N -1).