snmp_pdus.erl patch

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

snmp_pdus.erl patch

Martin Bjorklund-2
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