Skip to content

Commit

Permalink
netlink: Avoid passing NULL pointer to memcpy(), even with zero length.
Browse files Browse the repository at this point in the history
In nl_msg_push_flag(), the 3rd NULL parameter causing 'memcpy()'
with NULL source pointer in nl_msg_push_unspec().

Found by Clang.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
williamtu authored and blp committed Jul 3, 2016
1 parent 6ee9536 commit 75cbba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/netlink.c
Expand Up @@ -377,7 +377,7 @@ nl_msg_push_unspec(struct ofpbuf *msg, uint16_t type,
void
nl_msg_push_flag(struct ofpbuf *msg, uint16_t type)
{
nl_msg_push_unspec(msg, type, NULL, 0);
nl_msg_push_unspec_uninit(msg, type, 0);
}

/* Prepends a Netlink attribute of the given 'type' and the given 8-bit 'value'
Expand Down

0 comments on commit 75cbba3

Please sign in to comment.