[ovs-git] [openvswitch/ovs] 87c692: ovn-nbctl: Initialize arguments to avoid compilati...

GitHub noreply at github.com
Tue Jul 31 19:53:04 UTC 2018

  Branch: refs/heads/branch-2.10
  Home:   https://github.com/openvswitch/ovs
  Commit: 87c69290b3adff98395150fccb4a8a8fc9b91f4a
  Author: Ian Stokes <ian.stokes at intel.com>
  Date:   2018-07-31 (Tue, 31 Jul 2018)

  Changed paths:
    M ovn/utilities/ovn-nbctl.c

  Log Message:
  ovn-nbctl: Initialize arguments to avoid compilation warnings.

Output arguments for parse_priority() and dhcp_options_get() may not be
initialized when either function returns an error.

This causes compilation warnings for GCC 6.3.x regarding use of
uninitialized variable use and null-pointer-arithmetic.

Fix this by initializing priority_p* value to 0 for priority_parse()
when an error occurs during parsing.

For dhcp_options_get() set *dhcp_opts_p = dhcp_opts regardless as
dhcp_opts will be equal to NULL when an error occurs within the function

Cc: Jakub Sitnicki <jkbs at redhat.com>
Fixes: 3844c85de979 ("ovn-nbctl: Don't die in dhcp_options_get()."
Fixes: bc8223df3b01 ("ovn-nbctl: Don't die in parse_priority().")
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Jakub Sitnicki <jkbs at redhat.com>

      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

More information about the git mailing list