Browse Source

bzero cmsgbuf before using it, silences valgrind warnings.

henning@ "sure"
OPENBSD_5_8
brynet 9 years ago
parent
commit
1493b9464e
2 changed files with 4 additions and 2 deletions
  1. +2
    -1
      src/lib/libutil/imsg-buffer.c
  2. +2
    -1
      src/lib/libutil/imsg.c

+ 2
- 1
src/lib/libutil/imsg-buffer.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: imsg-buffer.c,v 1.5 2014/12/25 22:20:52 benno Exp $ */
/* $OpenBSD: imsg-buffer.c,v 1.6 2015/07/03 14:50:14 brynet Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -235,6 +235,7 @@ msgbuf_write(struct msgbuf *msgbuf)
bzero(&iov, sizeof(iov));
bzero(&msg, sizeof(msg));
bzero(&cmsgbuf, sizeof(cmsgbuf));
TAILQ_FOREACH(buf, &msgbuf->bufs, entry) {
if (i >= IOV_MAX)
break;


+ 2
- 1
src/lib/libutil/imsg.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: imsg.c,v 1.7 2015/06/11 19:25:53 reyk Exp $ */
/* $OpenBSD: imsg.c,v 1.8 2015/07/03 14:50:14 brynet Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -58,6 +58,7 @@ imsg_read(struct imsgbuf *ibuf)
struct imsg_fd *ifd;
bzero(&msg, sizeof(msg));
bzero(&cmsgbuf, sizeof(cmsgbuf));
iov.iov_base = ibuf->r.buf + ibuf->r.wpos;
iov.iov_len = sizeof(ibuf->r.buf) - ibuf->r.wpos;


Loading…
Cancel
Save