[erlang-bugs] erl crash on call to http_base_64

Dmitriy Kargapolov dmitry.kargapolov@REDACTED
Thu Oct 12 17:41:02 CEST 2006


Small example of segmentation-failing code:

test() ->
    [A,B,C] = [1,a,b],
    (A bsl 2) bor (B bsl 3) bor C.


datacompboy wrote:
> 
> 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
> _______________________________________________
> erlang-bugs mailing list
> erlang-bugs@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-bugs
> 



More information about the erlang-bugs mailing list