From 28e698cc7f492263b492c7033807bc3a35435484 Mon Sep 17 00:00:00 2001 From: Zakir Durumeric Date: Mon, 19 Aug 2013 22:46:05 -0400 Subject: [PATCH] fixing issue #28, fixing memset operation in send_nl_req. --- src/get_gateway.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/get_gateway.c b/src/get_gateway.c index 25eca38..e015fa8 100644 --- a/src/get_gateway.c +++ b/src/get_gateway.c @@ -72,7 +72,7 @@ int send_nl_req(uint16_t msg_type, uint32_t seq, return -1; } - memset(nlmsg, 0, sizeof(struct nlmsghdr)); + memset(nlmsg, 0, NLMSG_SPACE(payload_len)); memcpy(NLMSG_DATA(nlmsg), payload, payload_len); nlmsg->nlmsg_type = msg_type; nlmsg->nlmsg_len = NLMSG_LENGTH(payload_len);