mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
fish: fully init the msghdr buffers
This way no fields (msg_flags in particular) remain uninitialized.
This commit is contained in:
@@ -101,14 +101,13 @@ receive_stdout (int s)
|
||||
int fd;
|
||||
char buf[1];
|
||||
|
||||
memset (&msg, 0, sizeof msg);
|
||||
|
||||
msg.msg_iov = &iov;
|
||||
msg.msg_iovlen = 1;
|
||||
iov.iov_base = buf;
|
||||
iov.iov_len = sizeof buf;
|
||||
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
|
||||
msg.msg_control = control_un.control;
|
||||
msg.msg_controllen = sizeof (control_un.control);
|
||||
|
||||
@@ -163,6 +162,7 @@ send_stdout (int s)
|
||||
* It's unclear if this is hiding a real problem or not. XXX
|
||||
*/
|
||||
memset (&control_un, 0, sizeof control_un);
|
||||
memset (&msg, 0, sizeof msg);
|
||||
|
||||
/* On Linux you have to transmit at least 1 byte of real data. */
|
||||
msg.msg_iov = &iov;
|
||||
@@ -171,9 +171,6 @@ send_stdout (int s)
|
||||
iov.iov_base = buf;
|
||||
iov.iov_len = sizeof buf;
|
||||
|
||||
msg.msg_name = NULL;
|
||||
msg.msg_namelen = 0;
|
||||
|
||||
msg.msg_control = control_un.control;
|
||||
msg.msg_controllen = sizeof (control_un.control);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user