From e1eacd6b16b014eb42bcf6683ebe2334c3a35c68 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Fri, 29 Oct 2010 00:17:07 +0200 Subject: Fix use of uninitialized data at the end of netlink message The netlink message buffer is preallocated to a page and later expanded as needed. Everything was properly paded and zeroed out except for the unused part at the end. Use calloc() to allocate the buffer. --- lib/msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/msg.c b/lib/msg.c index 9fe9d54..6a8e14a 100644 --- a/lib/msg.c +++ b/lib/msg.c @@ -374,7 +374,7 @@ static struct nl_msg *__nlmsg_alloc(size_t len) nm->nm_refcnt = 1; - nm->nm_nlh = malloc(len); + nm->nm_nlh = calloc(1, len); if (!nm->nm_nlh) goto errout; -- cgit v0.12