From 815f48152fabff3afd1d1b542df9b3e775f4a6cb Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 15 Apr 2020 22:28:00 +0200 Subject: [PATCH] keyfile: avoid assertion failure in nm_keyfile_plugin_kf_get_{string,integer}_list() g_key_file_get_integer_list() can return %NULL without setting an error. That is the case if the key is set to an empty value. For X sake, this API. Read the documentation and figure out whether the function can return %NULL without reporting an error. Anyway, avoid the assertion failure. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/412 (cherry picked from commit 8f46425b11188641a8ac6e53614405212465b464) (cherry picked from commit 97139f5e3d968af90e8a2e75e5cddfcb10c5ac65) (cherry picked from commit 59d488cb46e0beed1260d398696c9283344bc855) (cherry picked from commit b82a8e4e010a443ebbe98c70177636fecaacf486) --- libnm-core/nm-keyfile-utils.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libnm-core/nm-keyfile-utils.c b/libnm-core/nm-keyfile-utils.c index e243150d02..0ffc3b1c26 100644 --- a/libnm-core/nm-keyfile-utils.c +++ b/libnm-core/nm-keyfile-utils.c @@ -92,7 +92,6 @@ nm_keyfile_plugin_kf_get_##stype##_list (GKeyFile *kf, \ list = g_key_file_get_##stype##_list (kf, alias, key, &l, &local); \ } \ } \ - nm_assert ((!local) != (!list)); \ if (local) \ g_propagate_error (error, local); \ if (!list) \