[nginx] Valgrind: another complaint about uninitialized bytes.

Maxim Dounin mdounin at mdounin.ru
Thu Jun 13 12:36:52 UTC 2013


details:   http://hg.nginx.org/nginx/rev/982678c5c270
branches:  
changeset: 5252:982678c5c270
user:      Tatsuhiko Kubo <cubicdaiya at gmail.com>
date:      Wed Jun 12 00:41:24 2013 +0900
description:
Valgrind: another complaint about uninitialized bytes.

diffstat:

 src/os/unix/ngx_channel.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff --git a/src/os/unix/ngx_channel.c b/src/os/unix/ngx_channel.c
--- a/src/os/unix/ngx_channel.c
+++ b/src/os/unix/ngx_channel.c
@@ -34,6 +34,8 @@ ngx_write_channel(ngx_socket_t s, ngx_ch
         msg.msg_control = (caddr_t) &cmsg;
         msg.msg_controllen = sizeof(cmsg);
 
+        ngx_memzero(&cmsg, sizeof(cmsg));
+
         cmsg.cm.cmsg_len = CMSG_LEN(sizeof(int));
         cmsg.cm.cmsg_level = SOL_SOCKET;
         cmsg.cm.cmsg_type = SCM_RIGHTS;



More information about the nginx-devel mailing list