diff options
author | Thomas Graf <tgraf@suug.ch> | 2011-03-17 16:03:11 +0100 |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2011-03-17 16:03:11 +0100 |
commit | 5a9f50b8e9be45094acbe313b31a81ceaabc6c96 (patch) | |
tree | d577fdb81950a580942f3223a319adba3d137621 | |
parent | ae5dfb1cc7268c5134a1ee1c911f3792b80ff7ea (diff) | |
download | libnl-5a9f50b8e9be45094acbe313b31a81ceaabc6c96.tar.gz |
__nlmsg_alloc(): Guarantee minimal message size of at least the header
-rw-r--r-- | lib/msg.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -400,6 +400,9 @@ static struct nl_msg *__nlmsg_alloc(size_t len) { struct nl_msg *nm; + if (len < sizeof(struct nlmsghdr)) + len = sizeof(struct nlmsghdr); + nm = calloc(1, sizeof(*nm)); if (!nm) goto errout; |