From e4cc504af53b1996cd76ebb3ddcd35b492f8620b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 5 Dec 2022 21:57:17 +0100 Subject: [PATCH] dhcp: fix crash in "nm-dhcp-helper" passing NULL to g_dbus_connection_flush_sync() "connection" variable might be NULL, which fails an assertion in g_dbus_connection_flush_sync(). Consequently, "error_flush" is also NULL which leads to a crash of "nm-dhcp-helper". Reported-by: Jules Maselbas Fixes: 240ec7f89119 ('dhcp: implement ACD (address collision detection) for DHCPv4') (cherry picked from commit 37e130232d1e5f9d6d55f550dc2234545f2fabf7) --- src/core/dhcp/nm-dhcp-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/dhcp/nm-dhcp-helper.c b/src/core/dhcp/nm-dhcp-helper.c index 78db617c6a..213d94965a 100644 --- a/src/core/dhcp/nm-dhcp-helper.c +++ b/src/core/dhcp/nm-dhcp-helper.c @@ -252,7 +252,7 @@ do_notify: success = FALSE; out: - if (!g_dbus_connection_flush_sync(connection, NULL, &error_flush)) { + if (connection && !g_dbus_connection_flush_sync(connection, NULL, &error_flush)) { _LOGE("could not flush D-Bus connection: %s", error_flush->message); /* if we considered this a success so far, don't fail because of this. */ }