summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Kumar Neelakantam <aneela@codeaurora.org>2018-07-19 14:25:22 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-07-25 22:57:06 -0700
commit596aa5c28ae21cda5b813c09093003ab137b33ef (patch)
tree7cd278acbf0237e1776bbfbca7a75657ed0ccbc6
parent640c42099bfa88171dbdffa0d0a0c73820b11a56 (diff)
net: ipc_router: Initialize the sockaddr in recvmsg() handler
sockaddr structure is filled with required information only which results in few memory locations of structure with uninitialized data. Memset complete structure before using it to remove uninitialized data. CRs-Fixed: 2274853 Change-Id: I181710bde100fb1553b925d9fdf227af35ff38b5 Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
-rw-r--r--net/ipc_router/ipc_router_socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipc_router/ipc_router_socket.c b/net/ipc_router/ipc_router_socket.c
index 23e4443fc1b2..7c82f7ff8874 100644
--- a/net/ipc_router/ipc_router_socket.c
+++ b/net/ipc_router/ipc_router_socket.c
@@ -143,6 +143,7 @@ static int msm_ipc_router_extract_msg(struct msghdr *m,
return -EINVAL;
}
ctl_msg = (union rr_control_msg *)(temp->data);
+ memset(addr, 0x0, sizeof(*addr));
addr->family = AF_MSM_IPC;
addr->address.addrtype = MSM_IPC_ADDR_ID;
addr->address.addr.port_addr.node_id = ctl_msg->cli.node_id;
@@ -151,6 +152,7 @@ static int msm_ipc_router_extract_msg(struct msghdr *m,
return offset;
}
if (addr && (hdr->type == IPC_ROUTER_CTRL_CMD_DATA)) {
+ memset(addr, 0x0, sizeof(*addr));
addr->family = AF_MSM_IPC;
addr->address.addrtype = MSM_IPC_ADDR_ID;
addr->address.addr.port_addr.node_id = hdr->src_node_id;