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

Issue 3026044: Fix one uninitialized and one incorrectly initialized arguments in sendmsg sy... (Closed)

Created:
10 years, 4 months ago by Evgeniy Stepanov
Modified:
9 years, 7 months ago
Reviewers:
Mark Seaborn, kcc
CC:
native-client-reviews_googlegroups.com
Visibility:
Public.

Description

Fix one uninitialized and one incorrectly initialized arguments in sendmsg syscall. Found with Valgrind. BUG=http://code.google.com/p/nativeclient/issues/detail?id=775 Committed: http://code.google.com/p/nativeclient/source/detail?r=2916

Patch Set 1 #

Total comments: 4

Patch Set 2 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -0 lines) Patch
M src/trusted/desc/posix/nacl_desc_conn_cap.c View 1 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
Evgeniy Stepanov
10 years, 4 months ago (2010-08-03 10:04:03 UTC) #1
Evgeniy Stepanov
10 years, 4 months ago (2010-08-03 10:21:22 UTC) #2
Mark Seaborn
http://codereview.chromium.org/3026044/diff/1/2 File src/trusted/desc/posix/nacl_desc_conn_cap.c (right): http://codereview.chromium.org/3026044/diff/1/2#newcode103 src/trusted/desc/posix/nacl_desc_conn_cap.c:103: connect_msg.msg_flags = 0; Good. Thanks for catching that. http://codereview.chromium.org/3026044/diff/1/2#newcode112 ...
10 years, 4 months ago (2010-08-03 10:22:14 UTC) #3
Evgeniy Stepanov
http://codereview.chromium.org/3026044/diff/1/2 File src/trusted/desc/posix/nacl_desc_conn_cap.c (right): http://codereview.chromium.org/3026044/diff/1/2#newcode112 src/trusted/desc/posix/nacl_desc_conn_cap.c:112: connect_msg.msg_controllen = cmsg->cmsg_len; On 2010/08/03 10:22:15, Mark Seaborn wrote: ...
10 years, 4 months ago (2010-08-03 10:42:40 UTC) #4
Mark Seaborn
On 2010/08/03 10:42:40, Evgeniy Stepanov wrote: > On 2010/08/03 10:22:15, Mark Seaborn wrote: > > ...
10 years, 4 months ago (2010-08-04 13:46:24 UTC) #5
Mark Seaborn
In description: > BUG=775 BTW, please use the full URL otherwise codereview.chromium.org links to the ...
10 years, 4 months ago (2010-08-04 13:47:21 UTC) #6
Evgeniy Stepanov
On 2010/08/04 13:46:24, Mark Seaborn wrote: > On 2010/08/03 10:42:40, Evgeniy Stepanov wrote: > > ...
10 years, 4 months ago (2010-08-04 14:10:40 UTC) #7
Mark Seaborn
On 2010/08/04 14:10:40, Evgeniy Stepanov wrote: > > Just remove the first msg_controllen assignment and ...
10 years, 4 months ago (2010-08-05 10:09:08 UTC) #8
Evgeniy Stepanov
10 years, 4 months ago (2010-08-05 11:05:10 UTC) #9
On 2010/08/05 10:09:08, Mark Seaborn wrote:
> On 2010/08/04 14:10:40, Evgeniy Stepanov wrote:
> > > Just remove the first msg_controllen assignment and this will LGTM.
> > 
> > No, this is exactly what man page suggests - first set it to the
> > available buffer space, then change it to the actual used bytes. Not
> > sure about CMSG_FIRSTHDR, but CMSG_NXTHDR definitely reads the
> > current buffer length and interprets it this way.
> 
> I think CMSG_FIRSTHDR doesn't read msg_controllen, but OK.
> 
> LGTM and sorry if I was overly picky!

Not at all. Thanks for reviewing this!

> Can you add a comment for why msg_controllen is assigned twice, and a
> comment to say that we use CMSG_LEN to avoid a valgrind warning?

Done.

> Thanks for investigating - I have also been seeing this warning when
> running valgrind on fake_browser_test.
> 
> Mark

Powered by Google App Engine
This is Rietveld 408576698