[ovs-git] [openvswitch/ovs] 8dff54: netdev-dpdk: Avoid undefined behavior processing d...

Aaron Conole noreply at github.com
Mon Jan 13 17:12:54 UTC 2020


  Branch: refs/heads/branch-2.10
  Home:   https://github.com/openvswitch/ovs
  Commit: 8dff54607d32f9405b6aa0ce1b113d8498a9e361
      https://github.com/openvswitch/ovs/commit/8dff54607d32f9405b6aa0ce1b113d8498a9e361
  Author: Aaron Conole <aconole at redhat.com>
  Date:   2020-01-13 (Mon, 13 Jan 2020)

  Changed paths:
    M lib/netdev-dpdk.c

  Log Message:
  -----------
  netdev-dpdk: Avoid undefined behavior processing devargs

In "Use of library functions" in the C standard, the following statement
is written to apply to all library functions:

  If an argument to a function has an invalid value (such as ... a
  null pointer ... the behavior is undefined.

Later, under the "String handling" section, "Comparison functions" no
exception is listed for strcmp, which means NULL is invalid.  It may
be possible for the smap_get to return NULL.

Given the above, we must check that new_devargs is not null.  The check
against NULL for new_devargs later in the function is still valid.

Fixes: 55e075e65ef9 ("netdev-dpdk: Arbitrary 'dpdk' port naming")
Signed-off-by: Aaron Conole <aconole at redhat.com>
Acked-by: Ciara Loftus <ciara.loftus at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>




More information about the git mailing list