diff --git a/net/tipc/netlink_compat.c b/net/tipc/netlink_compat.c index 0c82edebeb2c78ebe4a7f0a16e77cdbac8adfad4..d0603028bac43f67d2934ff4bd0c17586893eb54 100644 --- a/net/tipc/netlink_compat.c +++ b/net/tipc/netlink_compat.c @@ -824,6 +824,8 @@ static int tipc_nl_compat_name_table_dump_header(struct tipc_nl_compat_msg *msg) }; ntq = (struct tipc_name_table_query *)TLV_DATA(msg->req); + if (TLV_GET_DATA_LEN(msg->req) < sizeof(struct tipc_name_table_query)) + return -EINVAL; depth = ntohl(ntq->depth);