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.
This commit is contained in:
Thomas Graf 2010-10-29 00:17:07 +02:00
parent d0e564548f
commit e1eacd6b16

View file

@ -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;