]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
Merge branch 'master' into net-next
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 1 Sep 2017 21:15:31 +0000 (14:15 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 1 Sep 2017 21:15:31 +0000 (14:15 -0700)
1  2 
ip/iplink.c

diff --cc ip/iplink.c
index a132707fc52e6c31ef06531181d6b9fe95080b65,72c3479320686b79d694138a24003331fafa0a28..ff5b56c038d2857c4b076f219e22d0f4fd1563d4
@@@ -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