[erlang-questions] CC: erl segmentation fault in http_base_64

datacompboy datacompboy@REDACTED
Sun Oct 8 09:35:52 CEST 2006



datacompboy wrote:
http_base_64:decode("dGVzda==a").
(end of quote)


Intresting info: if start debugger and parse module http_base_64 from inets, we got 
=ERROR REPORT==== 8-Oct-2006::14:15:27 ===
Error in process <0.129.0> with exit value: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]}

** exited: {badarith,[{http_base_64,decode_base64_list,[{[29,26,pad,pad],"n"},"set"]}]} **

so, looks like that are core bug in runtime system!

... but for http_base_64 fix are simple:
change
decode_base64_list({[Sixtet1,Sixtet2,pad,pad], []}, Acc) ->
to
decode_base64_list({[Sixtet1,Sixtet2,pad,pad], _}, Acc) ->

and 
decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], []}, Acc) ->
to
decode_base64_list({[Sixtet1,Sixtet2,Sixtet3,pad], _}, Acc) ->
--
--- suicide proc near\n call death\n suicide endp
_________________________________________________________
Post sent from http://www.trapexit.org



More information about the erlang-questions mailing list