cli: fix crash in split_required_fields_for_con_show()
Depending on the architecture (calling convention), function arguments are evaluated in one order or the other. https://bugzilla.redhat.com/show_bug.cgi?id=1700409 Fixes:34e60bf228
('cli: cleanup split_required_fields_for_con_show()') (cherry picked from commitf4afb38bd9
)
This commit is contained in:
@@ -1534,6 +1534,7 @@ split_required_fields_for_con_show (const char *input,
|
||||
nm_auto_free_gstring GString *str2 = NULL;
|
||||
gboolean group_profile = FALSE;
|
||||
gboolean group_active = FALSE;
|
||||
gboolean do_free;
|
||||
|
||||
if (!input) {
|
||||
*profile_flds = NULL;
|
||||
@@ -1627,8 +1628,11 @@ split_required_fields_for_con_show (const char *input,
|
||||
g_string_truncate (str1, str1->len - 1);
|
||||
if (str2->len > 0)
|
||||
g_string_truncate (str2, str2->len - 1);
|
||||
*profile_flds = g_string_free (g_steal_pointer (&str1), str1->len == 0);
|
||||
*active_flds = g_string_free (g_steal_pointer (&str2), str2->len == 0);
|
||||
|
||||
do_free = (str1->len == 0);
|
||||
*profile_flds = g_string_free (g_steal_pointer (&str1), do_free);
|
||||
do_free = (str2->len == 0);
|
||||
*active_flds = g_string_free (g_steal_pointer (&str2), do_free);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user