Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

w1: avoid potential u16 overflow

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: David Fries <David@Fries.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

David Fries and committed by
Greg Kroah-Hartman
4b97b279 a30cfa47

+1 -1
+1 -1
drivers/w1/w1_netlink.c
··· 598 598 msg = (struct w1_netlink_msg *)(cn + 1); 599 599 if (node_count) { 600 600 int size; 601 - u16 reply_size = sizeof(*cn) + cn->len + slave_len; 601 + int reply_size = sizeof(*cn) + cn->len + slave_len; 602 602 if (cn->flags & W1_CN_BUNDLE) { 603 603 /* bundling duplicats some of the messages */ 604 604 reply_size += 2 * cmd_count * (sizeof(struct cn_msg) +