From: Roi Dayan Date: Tue, 31 Jan 2017 06:40:08 +0000 (+0200) Subject: netlink-socket: Fix possiblity of nl_transact dereferencing null pointer X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=d9c194a1c028a1a123ef104fc8794eef7004c036;p=ovs.git netlink-socket: Fix possiblity of nl_transact dereferencing null pointer Many nl_transact callers and its wrapper tc_transact pass NULL for replyp which is being accessed in error flow without being checked if null or not. Signed-off-by: Roi Dayan Reviewed-by: Paul Blakey Signed-off-by: Ben Pfaff --- diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index 7502764de..e45914c32 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -1698,7 +1698,9 @@ nl_transact(int protocol, const struct ofpbuf *request, error = nl_pool_alloc(protocol, &sock); if (error) { - *replyp = NULL; + if (replyp) { + *replyp = NULL; + } return error; }