diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2013-11-04 14:55:34 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2013-11-04 14:55:34 +0000 |
commit | 8c81b7655fe767a6182e4abc6ae5c234f0f2fcd9 (patch) | |
tree | 5bae1e9b2917944353acd3d47ed3c3ada052965d /src/rabbit_control_main.erl | |
parent | a33eddf510c61e7b8990a20967586b957a26a483 (diff) | |
download | rabbitmq-server-8c81b7655fe767a6182e4abc6ae5c234f0f2fcd9.tar.gz |
Validate utf-8-ness on the way into rabbitmqctl too.
Diffstat (limited to 'src/rabbit_control_main.erl')
-rw-r--r-- | src/rabbit_control_main.erl | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/rabbit_control_main.erl b/src/rabbit_control_main.erl index 6f36f99d..f3463286 100644 --- a/src/rabbit_control_main.erl +++ b/src/rabbit_control_main.erl @@ -706,7 +706,14 @@ unsafe_rpc(Node, Mod, Fun, Args) -> end. call(Node, {Mod, Fun, Args}) -> - rpc_call(Node, Mod, Fun, lists:map(fun list_to_binary/1, Args)). + rpc_call(Node, Mod, Fun, lists:map(fun list_to_binary_utf8/1, Args)). + +list_to_binary_utf8(L) -> + B = list_to_binary(L), + case rabbit_binary_parser:validate_utf8(B) of + ok -> B; + error -> throw({error, {not_utf_8, L}}) + end. rpc_call(Node, Mod, Fun, Args) -> rpc:call(Node, Mod, Fun, Args, ?RPC_TIMEOUT). |