From 8d78f8effb67a6c5dca93dbbaa45efd4a0196ecb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 5 Nov 2020 21:23:11 +0100 Subject: [PATCH] core/ovs: avoid possible crash in _add_interface() --- src/devices/ovs/nm-ovsdb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/ovs/nm-ovsdb.c b/src/devices/ovs/nm-ovsdb.c index 9b50b1aa74..b1d09ce5b8 100644 --- a/src/devices/ovs/nm-ovsdb.c +++ b/src/devices/ovs/nm-ovsdb.c @@ -1313,7 +1313,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg) if (old) { ovs_port = g_hash_table_lookup(priv->ports, key); - if (!new || !nm_streq0(ovs_port->name, name)) { + if (!new || (ovs_port && !nm_streq0(ovs_port->name, name))) { old = FALSE; _LOGT("removed a port: %s%s%s", ovs_port->name, @@ -1378,7 +1378,7 @@ ovsdb_got_update(NMOvsdb *self, json_t *msg) if (old) { ovs_bridge = g_hash_table_lookup(priv->bridges, key); - if (!new || !nm_streq0(ovs_bridge->name, name)) { + if (!new || (ovs_bridge && !nm_streq0(ovs_bridge->name, name))) { old = FALSE; _LOGT("removed a bridge: %s%s%s", ovs_bridge->name,