]> 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)
commit5e2bdac60d47bc31451ded57c5caa73166212772
treef6978c9de4fd5c6d35c0a4faf3400df5a29820c1
parenta891e09e59cfede211c5f57c80115244e4e5ecec
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