Skip to content

Commit

Permalink
bugfix: regression caused by wrong check
Browse files Browse the repository at this point in the history
  • Loading branch information
bbonev committed Jul 9, 2020
1 parent 3484f93 commit b9bee82
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,12 +558,11 @@ int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data,
fprintf(stderr, "addattr_l ERROR: message exceeded bound of %d\n",maxlen);
return -1;
}
if (!data)
return -1;
rta = NLMSG_TAIL(n);
rta->rta_type = type;
rta->rta_len = len;
memcpy(RTA_DATA(rta), data, alen);
if (data)
memcpy(RTA_DATA(rta), data, alen);
n->nlmsg_len = NLMSG_ALIGN(n->nlmsg_len) + RTA_ALIGN(len);
return 0;
}
Expand Down

0 comments on commit b9bee82

Please sign in to comment.