c
static size_t safe_size_calc(size_t a, size_t b, size_t c) {
    if (a > SIZE_MAX - b || a + b > SIZE_MAX - c)
        return 0;
    return a + b + c;
}

size_t size = safe_size_calc(NLMSG_ALIGN(sizeof(struct ifaddrmsg)),
                             nla_total_size(1), nla_total_size(4));
if (size == 0)
    goto errout;
skb = nlmsg_new(size, GFP_KERNEL);
