[ovs-git] [openvswitch/ovs] f09182: ofp-group: Use big-enough buffer in ofputil_format...

Ben Pfaff noreply at github.com
Fri May 7 19:22:10 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: f09182a3b4fbbbae090f4812342e16984e6ea8be
      https://github.com/openvswitch/ovs/commit/f09182a3b4fbbbae090f4812342e16984e6ea8be
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-05-07 (Fri, 07 May 2021)

  Changed paths:
    M lib/ofp-group.c

  Log Message:
  -----------
  ofp-group: Use big-enough buffer in ofputil_format_group().

GCC 11 pointed out that ofputil_group_to_string()'s prototype asks for
a buffer with one byte more than supplied.  This fixes the problem.

This wasn't a buffer overflow because ofputil_group_to_string() honors
the buffer size passed in, which was correct.  The worst that could
happen was truncating the last byte of a group name.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Paolo Valerio <pvalerio at redhat.com>


  Commit: b96d2756f214bea6c41ce4800ce0f89c61000108
      https://github.com/openvswitch/ovs/commit/b96d2756f214bea6c41ce4800ce0f89c61000108
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-05-07 (Fri, 07 May 2021)

  Changed paths:
    M lib/tnl-neigh-cache.h

  Log Message:
  -----------
  tnl-neigh-cache: Include expected array sizes in prototypes.

GCC 11 warned that the prototypes and the definitions of these
functions were different: the prototypes used [], the definitions used
[IFNAMSIZ].  This is perfectly valid from a C standards perspective, but
it's confusing and providing sizes gives the compiler and the developer
a useful hint as to usage.  Therefore, this commit adds the expected
sizes.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Paolo Valerio <pvalerio at redhat.com>


  Commit: 721488d4a5f497f5693e286cf6f1916804bce2eb
      https://github.com/openvswitch/ovs/commit/721488d4a5f497f5693e286cf6f1916804bce2eb
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2021-05-07 (Fri, 07 May 2021)

  Changed paths:
    M lib/classifier.c

  Log Message:
  -----------
  classifier: Make find_match_wc() prototype and definition match.

The prototype said *, the definition said [CLS_MAX_TRIES].  GCC 11
complains about this (though it is perfectly valid from a C standards
perspective).  It would probably be better to make them both use
[CLS_MAX_TRIES] but that's only allowed if the struct's definition is
visible at the point of the prototype, which it's not.  Instead of
moving the definition, this commit just changes both usages to *.

Signed-off-by: Ben Pfaff <blp at ovn.org>
Acked-by: Paolo Valerio <pvalerio at redhat.com>


Compare: https://github.com/openvswitch/ovs/compare/09fe18af2d83...721488d4a5f4


More information about the git mailing list