Skip to content
This repository has been archived by the owner on Nov 22, 2019. It is now read-only.

Commit

Permalink
Fix a small issue in the patch server that could lead to a crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Hoguin committed Mar 28, 2011
1 parent c957d9a commit 0a39923
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/egs_patch_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ recv(CSocket, SoFar, State) ->
%% @doc Split the given binary into a list of commands.
split(<< >>, Acc) ->
{lists:reverse(Acc), << >>};
split(Rest = << Size:32/little, Data/bits >>, Acc) when Data + 4 < Size ->
split(Rest = << Size:32/little, Data/bits >>, Acc) when byte_size(Data) + 4 < Size ->
{lists:reverse(Acc), Rest};
split(<< Size:32/little, Cmd:16/little, _Junk:16, Rest/bits >>, Acc) ->
BitSize = 8 * Size - 64,
Expand Down

0 comments on commit 0a39923

Please sign in to comment.