[ovs-git] [openvswitch/ovs] 6c2d51: netdev: check for NULL fields in netdev_get_addrs

GitHub noreply at github.com
Tue Aug 8 23:46:16 UTC 2017


  Branch: refs/heads/branch-2.8
  Home:   https://github.com/openvswitch/ovs
  Commit: 6c2d5127daa3a3da3f00e6f2e9cb285b322b5794
      https://github.com/openvswitch/ovs/commit/6c2d5127daa3a3da3f00e6f2e9cb285b322b5794
  Author: Daniel Alvarez <dalvarez at redhat.com>
  Date:   2017-08-08 (Tue, 08 Aug 2017)

  Changed paths:
    M lib/netdev.c

  Log Message:
  -----------
  netdev: check for NULL fields in netdev_get_addrs

When the interfaces list is retrieved through getiffaddrs(), there
might be elements with iface_name set to NULL.

This patch checks ifa_name to be not NULL before comparing it to the
actual device name in the loop that calculates how many interfaces
exist with that same name.

Also, this patch checks that ifa_netmask is not NULL for coherence
with the existing code so that it doesn't allocate more memory
than needed if this field is NULL.

Note, that these checks are already being done later in the function
so it should be done in both places.

Signed-off-by: Daniel Alvarez <dalvarez at redhat.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Lance Richardson <lrichard at redhat.com>




More information about the git mailing list