Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(987)

Unified Diff: src/trusted/desc/posix/nacl_desc_conn_cap.c

Issue 3026044: Fix one uninitialized and one incorrectly initialized arguments in sendmsg sy... (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/desc/posix/nacl_desc_conn_cap.c
===================================================================
--- src/trusted/desc/posix/nacl_desc_conn_cap.c (revision 2914)
+++ src/trusted/desc/posix/nacl_desc_conn_cap.c (working copy)
@@ -100,6 +100,7 @@
connect_msg.msg_namelen = 0;
connect_msg.msg_control = control_buf;
connect_msg.msg_controllen = sizeof(control_buf);
+ connect_msg.msg_flags = 0;
cmsg = CMSG_FIRSTHDR(&connect_msg);
cmsg->cmsg_len = CMSG_LEN(sizeof(int));
@@ -108,6 +109,8 @@
/* We use memcpy() rather than assignment through a cast to avoid
strict-aliasing warnings */
memcpy(CMSG_DATA(cmsg), &sock_pair[0], sizeof(int));
+ /* Set msg_controllen to the actual size of the cmsg. */
+ connect_msg.msg_controllen = cmsg->cmsg_len;
sent = sendmsg(self->connect_fd, &connect_msg, 0);
NaClClose(sock_pair[0]);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698