diff mbox

[ovs-dev,3/7] netlink: Fix passing null pointer reported by clang.

Message ID 1467176548-40488-4-git-send-email-u9012063@gmail.com
State Accepted
Headers show

Commit Message

William Tu June 29, 2016, 5:02 a.m. UTC
In nl_msg_push_flag(), the 3rd NULL parameter causing 'memcpy()'
with NULL source pointer in nl_msg_push_unspec().

Signed-off-by: William Tu <u9012063@gmail.com>
---
 lib/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ben Pfaff July 3, 2016, 4:21 a.m. UTC | #1
On Tue, Jun 28, 2016 at 10:02:24PM -0700, William Tu wrote:
> In nl_msg_push_flag(), the 3rd NULL parameter causing 'memcpy()'
> with NULL source pointer in nl_msg_push_unspec().
> 
> Signed-off-by: William Tu <u9012063@gmail.com>

Applied, thanks!
diff mbox

Patch

diff --git a/lib/netlink.c b/lib/netlink.c
index 5d8a147..fbdb78e 100644
--- a/lib/netlink.c
+++ b/lib/netlink.c
@@ -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'