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:
parent
d0e564548f
commit
e1eacd6b16
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue