[erlang-patches] snmp_pdus.erl patch

Martin Bjorklund mbj@REDACTED
Thu Jan 3 11:28:21 CET 2008


Hi,

There is a bug in snmp_pdus:enc_oct_str_tag/1.  All the enc_*
functions are supposed to return a flat list, but the second clause of
this function does not.  If it gets a binary it returns a deep list.

Change:

enc_oct_str_tag(OStr) when list(OStr) ->
    lists:append([4|elength(length(OStr))],OStr);
enc_oct_str_tag(OBin) ->
    [4,elength(size(OBin)),OBin].

Into:

enc_oct_str_tag(OStr) when list(OStr) ->
    lists:append([4|elength(length(OStr))],OStr);
enc_oct_str_tag(OBin) ->
    [4|elength(size(OBin))]++binary_to_list(OBin).


/martin



More information about the erlang-patches mailing list