]> git.feebdaed.xyz Git - 0xmirror/ovs.git/commitdiff
ovsdb: monitor: Silence dereference after null check warning.
authorEelco Chaudron <echaudro@redhat.com>
Mon, 1 Sep 2025 10:10:37 +0000 (12:10 +0200)
committerEelco Chaudron <echaudro@redhat.com>
Thu, 4 Sep 2025 06:40:25 +0000 (08:40 +0200)
This patch resolves a Coverity-reported issue where a dereference
could occur after a null check in ovsdb_monitor_row_update_type().
An additional condition has been added to ensure a safe early exit
in ovsdb_monitor_compose_row_update().

Acked-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
ovsdb/monitor.c

index c3bfae3d2a181c7edcc2cd57b16a0ddb243e60e1..4998687c1032ecdc74cda79f0c8d0c078694082f 100644 (file)
@@ -681,7 +681,7 @@ ovsdb_monitor_change_set_destroy(struct ovsdb_monitor_change_set *mcs)
 static enum ovsdb_monitor_selection
 ovsdb_monitor_row_update_type(bool initial, const bool old, const bool new)
 {
-    return initial ? OJMS_INITIAL
+    return initial ? (new ? OJMS_INITIAL : OJMS_NONE)
             : !old ? OJMS_INSERT
             : !new ? OJMS_DELETE
             : OJMS_MODIFY;