dect
/
libnl
Archived
13
0
Fork 0

__nlmsg_alloc(): Guarantee minimal message size of at least the header

This commit is contained in:
Thomas Graf 2011-03-17 16:03:11 +01:00
parent ae5dfb1cc7
commit 5a9f50b8e9
1 changed files with 3 additions and 0 deletions

View File

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