diff options
author | Thomas Graf <tgraf@suug.ch> | 2010-10-28 22:17:07 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2010-10-28 22:17:07 (GMT) |
commit | e1eacd6b16b014eb42bcf6683ebe2334c3a35c68 (patch) | |
tree | 4708227a9cb93a54a5d3f0c0325da7d450470eae /lib | |
parent | d0e564548f6eff0a8d49e5e9cb618a8d297a1b98 (diff) | |
download | libnl-e1eacd6b16b014eb42bcf6683ebe2334c3a35c68.zip libnl-e1eacd6b16b014eb42bcf6683ebe2334c3a35c68.tar.gz libnl-e1eacd6b16b014eb42bcf6683ebe2334c3a35c68.tar.bz2 |
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.
Diffstat (limited to 'lib')
-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; |