From 38d92c940107f55e93c4dd9abdee19e74cc3a732 Mon Sep 17 00:00:00 2001 From: Shawn <506895667@qq.com> Date: Tue, 20 Jun 2023 10:30:06 +0800 Subject: [PATCH] fix: add range validation for max_clientid_len --- priv/emqx.schema | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/priv/emqx.schema b/priv/emqx.schema index 9e2487757..7aa0592f2 100644 --- a/priv/emqx.schema +++ b/priv/emqx.schema @@ -276,6 +276,9 @@ end}. {validator, "range:1-65535", "must be 1 to 65535", fun(X) -> X >= 1 andalso X =< 65535 end}. +{validator, "range:23-65535", "must be 23 to 65535", + fun(X) -> X >= 23 andalso X =< 65535 end}. + {validator, "range:1-9", "must be 1 to 9", fun(X) -> X >= 1 andalso X =< 9 end}. @@ -955,7 +958,8 @@ end}. %% @doc Set the Max ClientId Length Allowed. {mapping, "mqtt.max_clientid_len", "emqx.max_clientid_len", [ {default, 65535}, - {datatype, integer} + {datatype, integer}, + {validators, ["range:23-65535"]} ]}. %% @doc Set the Maximum topic levels.