Crash in SSL-connection format_reply R13B04

Henrik Nord henrik.nord@REDACTED
Tue Nov 2 16:10:20 CET 2010


We get a crash in ssl_connection when trying to receive an http packet:

Here are some traces:

call ssl_connection:format_reply({socket_options,list,http,0,0,false},{http_request,'GET',{abs_path,"/"},{1,1}})
(<0.659.0>) call ssl_connection:format_reply(list,0,{http_request,'GET',{abs_path,"/"},{1,1}})
(<0.659.0>) exception_from {ssl_connection,format_reply,3} {error,badarg}
(<0.659.0>) exception_from {ssl_connection,format_reply,2} {error,badarg}
*failed*
::exit:{econnrefused,[{lhttpc_client,send_request,1},
                    {lhttpc_client,execute,9},
                    {lhttpc_client,request,9}]}
  in function lhttpc:request/9
  in call from tl_async:'-call/3-fun-0-'/3


(<0.659.0>) call ssl_connection:terminate({badarg,[{erlang,binary_to_list,[{http_request,'GET',{abs_path,"/"},{1,1}}]},
         {ssl_connection,format_reply,3},
         {ssl_connection,format_reply,2},
         {ssl_connection,deliver_app_data,4},
         {ssl_connection,application_data,2},
         {ssl_connection,handle_event,3},


Relevant Code:
in ssl_connection.erl
format_reply(list,     _, Data) ->  binary_to_list(Data);
format_reply(binary,   0, Data) ->  Data;
format_reply(binary, raw, Data) ->  Data;
format_reply(binary,   N, Data) ->  % Header mode
    <<Header:N/binary, Rest/binary>> = Data,
    [binary_to_list(Header), Rest].


Is this already fixed in R14, and/or can we get a patch for R13B04 ?

Thanks


More information about the erlang-bugs mailing list