summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoi Dayan <roid@mellanox.com>2017-01-31 08:40:08 +0200
committerBen Pfaff <blp@ovn.org>2017-01-31 08:11:47 -0800
commitd9c194a1c028a1a123ef104fc8794eef7004c036 (patch)
tree3ff8a2e7fe2c258aa59a809f349efa211ccaed51
parentcb7406d86eadf7605cd9b808f9142fa05f04a21f (diff)
downloadopenvswitch-d9c194a1c028a1a123ef104fc8794eef7004c036.tar.gz
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 <roid@mellanox.com> Reviewed-by: Paul Blakey <paulb@mellanox.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r--lib/netlink-socket.c4
1 files changed, 3 insertions, 1 deletions
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;
}