Coverity: Initialize msg buffer.
authorRichard W.M. Jones <rjones@redhat.com>
Tue, 23 Aug 2011 18:29:46 +0000 (19:29 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Tue, 23 Aug 2011 18:29:46 +0000 (19:29 +0100)
msg_flags was not being initialized and would have been passed to
sendmsg with a random value.

fish/rc.c

index 721c613..1744c41 100644 (file)
--- a/fish/rc.c
+++ b/fish/rc.c
@@ -71,6 +71,7 @@ receive_stdout (int s)
   }
 
   /* Don't specify a source */
   }
 
   /* Don't specify a source */
+  memset (&msg, 0, sizeof msg);
   msg.msg_name = NULL;
   msg.msg_namelen = 0;
 
   msg.msg_name = NULL;
   msg.msg_namelen = 0;
 
@@ -118,6 +119,7 @@ send_stdout (int s)
   char buf[1];
 
   /* Don't specify a destination */
   char buf[1];
 
   /* Don't specify a destination */
+  memset (&msg, 0, sizeof msg);
   msg.msg_name    = NULL;
   msg.msg_namelen = 0;
 
   msg.msg_name    = NULL;
   msg.msg_namelen = 0;