diff options
author | Thomas Graf <tgraf@suug.ch> | 2010-10-29 00:17:07 +0200 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2010-10-29 00:17:07 +0200 |
commit | e1eacd6b16b014eb42bcf6683ebe2334c3a35c68 (patch) | |
tree | 4708227a9cb93a54a5d3f0c0325da7d450470eae | |
parent | d0e564548f6eff0a8d49e5e9cb618a8d297a1b98 (diff) |
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.
-rw-r--r-- | lib/msg.c | 2 |
1 files changed, 1 insertions, 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; |