]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix missing initializer in tipc_sendmsg()
authorJon Maloy <jon.maloy@ericsson.com>
Wed, 11 Apr 2018 23:15:48 +0000 (01:15 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 Apr 2018 01:55:38 +0000 (21:55 -0400)
commit44c74c56654e5f83b35b42c2144fe727b7b2b28f
treef6978c9de4fd5c6d35c0a4faf3400df5a29820c1
parentcf705617adb36bbb4c2b96a589dfd4e44a8d071d
tipc: fix missing initializer in tipc_sendmsg()

The stack variable 'dnode' in __tipc_sendmsg() may theoretically
end up tipc_node_get_mtu() as an unitilalized variable.

We fix this by intializing the variable at declaration. We also add
a default else clause to the two conditional ones already there, so
that we never end up in the named function if the given address
type is illegal.

Reported-by: syzbot+b0975ce9355b347c1546@syzkaller.appspotmail.com
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c