mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-09 08:18:03 +02:00
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()')
This commit is contained in:
parent
ba461085a2
commit
f4afb38bd9
1 changed files with 6 additions and 2 deletions
|
|
@ -1534,6 +1534,7 @@ split_required_fields_for_con_show (const char *input,
|
||||||
nm_auto_free_gstring GString *str2 = NULL;
|
nm_auto_free_gstring GString *str2 = NULL;
|
||||||
gboolean group_profile = FALSE;
|
gboolean group_profile = FALSE;
|
||||||
gboolean group_active = FALSE;
|
gboolean group_active = FALSE;
|
||||||
|
gboolean do_free;
|
||||||
|
|
||||||
if (!input) {
|
if (!input) {
|
||||||
*profile_flds = NULL;
|
*profile_flds = NULL;
|
||||||
|
|
@ -1627,8 +1628,11 @@ split_required_fields_for_con_show (const char *input,
|
||||||
g_string_truncate (str1, str1->len - 1);
|
g_string_truncate (str1, str1->len - 1);
|
||||||
if (str2->len > 0)
|
if (str2->len > 0)
|
||||||
g_string_truncate (str2, str2->len - 1);
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue