Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove unkown elements from encoding

Remove the unknown element types from the management body encoding.
Most of these elements do not have a specified type (like timestamp)
and are handled by the calling function.

The check for a known type is weak: we look for an integer rather than
a tuple ({unsupported, type}).
  • Loading branch information...
commit 8f5203f833c551010f605e01516b9a59f99698ec 1 parent a831fae
@msantos authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/wierl_frame.erl
View
5 src/wierl_frame.erl
@@ -713,7 +713,10 @@ element_type(N) -> {unsupported, N}.
elements_to_bin(N) when is_binary(N) ->
N;
elements_to_bin(N) when is_list(N) ->
- management_body(N).
+ % Remove unhandled types (weak check, element_type returns a
+ % tuple ({unsupported, Key} on failure)
+ Elements = [ {K,V} || {K,V} <- N, is_integer(element_type(K)) ],
+ management_body(Elements).
management_body(Body) ->
Please sign in to comment.
Something went wrong with that request. Please try again.