From: Stephen Hemminger Date: Fri, 1 Sep 2017 21:15:31 +0000 (-0700) Subject: Merge branch 'master' into net-next X-Git-Tag: v4.14.0~39^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=731e28cc28031b3c1fc8496f4ffa8b37373d12c1;p=thirdparty%2Fiproute2.git Merge branch 'master' into net-next --- 731e28cc28031b3c1fc8496f4ffa8b37373d12c1 diff --cc ip/iplink.c index a132707fc,72c347932..ff5b56c03 --- a/ip/iplink.c +++ b/ip/iplink.c @@@ -1041,8 -1040,12 +1041,13 @@@ int iplink_get(unsigned int flags, cha if (rtnl_talk(&rth, &req.n, &answer.n, sizeof(answer)) < 0) return -2; + if (answer.n.nlmsg_len > sizeof(answer.buf)) { + fprintf(stderr, "Message truncated from %u to %lu\n", + answer.n.nlmsg_len, sizeof(answer.buf)); + return -2; + } + open_json_object(NULL); if (brief) print_linkinfo_brief(NULL, &answer.n, stdout, NULL); else