==27395== Syscall param socketcall.sendmsg(msg.msg_iov[i]) points to uninitialised byte(s)
==27395== at 0x546C6A0: __sendmsg_nocancel (syscall-template.S:82)
==27395== by 0x4E30880: lttcomm_send_creds_unix_sock (sessiond-comm.c:449)
==27395== by 0x4E2F584: ask_sessiond (lttng-ctl.c:99)
==27395== by 0x4E2FC85: lttng_list_tracepoints (lttng-ctl.c:667)
==27395== by 0x4039C1: cmd_list (list.c:314)
==27395== by 0x40217C: main (lttng.c:266)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len)
{
*/
ssize_t lttcomm_recv_unix_sock(int sock, void *buf, size_t len)
{
- struct msghdr msg = { 0 };
struct iovec iov[1];
ssize_t ret = -1;
struct iovec iov[1];
ssize_t ret = -1;
+ memset(&msg, 0, sizeof(msg));
+
iov[0].iov_base = buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
iov[0].iov_base = buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
*/
ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
{
*/
ssize_t lttcomm_send_unix_sock(int sock, void *buf, size_t len)
{
- struct msghdr msg = { 0 };
struct iovec iov[1];
ssize_t ret = -1;
struct iovec iov[1];
ssize_t ret = -1;
+ memset(&msg, 0, sizeof(msg));
+
iov[0].iov_base = buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
iov[0].iov_base = buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
*/
ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
{
*/
ssize_t lttcomm_send_fds_unix_sock(int sock, int *fds, size_t nb_fd)
{
- struct msghdr msg = { 0 };
struct cmsghdr *cmptr;
struct iovec iov[1];
ssize_t ret = -1;
struct cmsghdr *cmptr;
struct iovec iov[1];
ssize_t ret = -1;
char tmp[CMSG_SPACE(sizeof_fds)];
char dummy = 0;
char tmp[CMSG_SPACE(sizeof_fds)];
char dummy = 0;
+ memset(&msg, 0, sizeof(msg));
+
if (nb_fd > LTTCOMM_MAX_SEND_FDS)
return -EINVAL;
if (nb_fd > LTTCOMM_MAX_SEND_FDS)
return -EINVAL;
struct cmsghdr *cmsg;
size_t sizeof_fds = nb_fd * sizeof(int);
char recv_fd[CMSG_SPACE(sizeof_fds)];
struct cmsghdr *cmsg;
size_t sizeof_fds = nb_fd * sizeof(int);
char recv_fd[CMSG_SPACE(sizeof_fds)];
- struct msghdr msg = { 0 };
+ memset(&msg, 0, sizeof(msg));
+
/* Prepare to receive the structures */
iov[0].iov_base = &dummy;
iov[0].iov_len = 1;
/* Prepare to receive the structures */
iov[0].iov_base = &dummy;
iov[0].iov_len = 1;
*/
ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
{
*/
ssize_t lttcomm_send_creds_unix_sock(int sock, void *buf, size_t len)
{
- struct msghdr msg = { 0 };
struct cmsghdr *cmptr;
struct iovec iov[1];
ssize_t ret = -1;
struct cmsghdr *cmptr;
struct iovec iov[1];
ssize_t ret = -1;
size_t sizeof_cred = sizeof(struct ucred);
char anc_buf[CMSG_SPACE(sizeof_cred)];
size_t sizeof_cred = sizeof(struct ucred);
char anc_buf[CMSG_SPACE(sizeof_cred)];
+ memset(&msg, 0, sizeof(msg));
+
iov[0].iov_base = buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
iov[0].iov_base = buf;
iov[0].iov_len = len;
msg.msg_iov = iov;
ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
struct ucred *creds)
{
ssize_t lttcomm_recv_creds_unix_sock(int sock, void *buf, size_t len,
struct ucred *creds)
{
- struct msghdr msg = { 0 };
struct cmsghdr *cmptr;
struct iovec iov[1];
ssize_t ret;
size_t sizeof_cred = sizeof(struct ucred);
char anc_buf[CMSG_SPACE(sizeof_cred)];
struct cmsghdr *cmptr;
struct iovec iov[1];
ssize_t ret;
size_t sizeof_cred = sizeof(struct ucred);
char anc_buf[CMSG_SPACE(sizeof_cred)];
+ memset(&msg, 0, sizeof(msg));
+
/* Not allowed */
if (creds == NULL) {
ret = -1;
/* Not allowed */
if (creds == NULL) {
ret = -1;