__nlmsg_alloc(): Guarantee minimal message size of at least the header
This commit is contained in:
parent
ae5dfb1cc7
commit
5a9f50b8e9
1 changed files with 3 additions and 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;
|
||||
|
|
Loading…
Add table
Reference in a new issue