diff --git a/lib/msg.c b/lib/msg.c index 6478507..3c58cb7 100644 --- a/lib/msg.c +++ b/lib/msg.c @@ -153,7 +153,7 @@ struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh, int hdrlen) */ int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) { - return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen); + return max_t(int, nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen), 0); } /** @} */