|
@@ -403,7 +403,12 @@ static int tipc_nl_compat_bearer_enable(struct tipc_nl_compat_cmd_doit *cmd,
|
|
|
if (!bearer)
|
|
if (!bearer)
|
|
|
return -EMSGSIZE;
|
|
return -EMSGSIZE;
|
|
|
|
|
|
|
|
- len = min_t(int, TLV_GET_DATA_LEN(msg->req), TIPC_MAX_BEARER_NAME);
|
|
|
|
|
|
|
+ len = TLV_GET_DATA_LEN(msg->req);
|
|
|
|
|
+ len -= offsetof(struct tipc_bearer_config, name);
|
|
|
|
|
+ if (len <= 0)
|
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
+
|
|
|
|
|
+ len = min_t(int, len, TIPC_MAX_BEARER_NAME);
|
|
|
if (!string_is_valid(b->name, len))
|
|
if (!string_is_valid(b->name, len))
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|