summaryrefslogtreecommitdiff
path: root/ovsdb
diff options
context:
space:
mode:
authorAdrian Moreno <amorenoz@redhat.com>2022-03-23 12:56:13 +0100
committerIlya Maximets <i.maximets@ovn.org>2022-03-30 16:59:02 +0200
commitd4566085edf50033087652f35f92b9b77cbec70f (patch)
treeb44b7c6a2268e5b8f66c36c13a2eb771644569e8 /ovsdb
parent5a2940978e0411267761d483e0777296fb0ebf7f (diff)
downloadopenvswitch-d4566085edf50033087652f35f92b9b77cbec70f.tar.gz
list: use multi-variable helpers for list loops.
Use multi-variable iteration helpers to rewrite non-safe loops. There is an important behavior change compared with the previous implementation: When the loop ends normally (i.e: not via "break;"), the object pointer provided by the user is NULL. This is safer because it's not guaranteed that it would end up pointing a valid address. For pop iterator, set the variable to NULL when the loop ends. Clang-analyzer has successfully picked the potential null-pointer dereference on the code that triggered this change (bond.c) and nothing else has been detected. For _SAFE loops, use the LONG version for backwards compatibility. Acked-by: Eelco Chaudron <echaudro@redhat.com> Acked-by: Dumitru Ceara <dceara@redhat.com> Signed-off-by: Adrian Moreno <amorenoz@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'ovsdb')
0 files changed, 0 insertions, 0 deletions