summaryrefslogtreecommitdiff
path: root/src/rabbit_control_main.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2013-11-04 14:55:34 +0000
committerSimon MacMullen <simon@rabbitmq.com>2013-11-04 14:55:34 +0000
commit8c81b7655fe767a6182e4abc6ae5c234f0f2fcd9 (patch)
tree5bae1e9b2917944353acd3d47ed3c3ada052965d /src/rabbit_control_main.erl
parenta33eddf510c61e7b8990a20967586b957a26a483 (diff)
downloadrabbitmq-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.erl9
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).