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>
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;