[ovs-dev] [coverity2 2/7] netdev-linux: Zero-out "sin" in netdev_linux_arp_lookup().

Justin Pettit jpettit at nicira.com
Wed Feb 23 06:18:28 UTC 2011


Coverity complains that we're copying the unitialized "sin_zero" member
from "sin" into "r".  I don't think this is an actual problem, but
there's no harm in zeroing out the structure, either.

Coverity #10916
---
 lib/netdev-linux.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 0aceb45..a27a625 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -2045,6 +2045,7 @@ netdev_linux_arp_lookup(const struct netdev *netdev,
     int retval;
 
     memset(&r, 0, sizeof r);
+    memset(&sin, 0, sizeof sin);
     sin.sin_family = AF_INET;
     sin.sin_addr.s_addr = ip;
     sin.sin_port = 0;
-- 
1.7.1





More information about the dev mailing list