mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 03:20:18 +01:00
tui: fix accessing NULL in g_bytes_get_data()
GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed
GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed
libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed
GLib-CRITICAL **: g_bytes_get_size: assertion 'bytes != NULL' failed
GLib-CRITICAL **: g_bytes_get_data: assertion 'bytes != NULL' failed
libnm-CRITICAL **: nm_utils_ssid_to_utf8: assertion 'ssid != NULL' failed
Additional fixes to commit 4359e556e4.
This commit is contained in:
parent
33e50e817b
commit
e7666a8532
1 changed files with 10 additions and 4 deletions
|
|
@ -138,8 +138,11 @@ ssid_transform_to_entry (GBinding *binding,
|
|||
char *utf8;
|
||||
|
||||
ssid = g_value_get_boxed (source_value);
|
||||
utf8 = nm_utils_ssid_to_utf8 (g_bytes_get_data (ssid, NULL),
|
||||
g_bytes_get_size (ssid));
|
||||
if (ssid)
|
||||
utf8 = nm_utils_ssid_to_utf8 (g_bytes_get_data (ssid, NULL),
|
||||
g_bytes_get_size (ssid));
|
||||
else
|
||||
utf8 = g_strdup ("");
|
||||
g_value_take_string (target_value, utf8);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -158,8 +161,11 @@ ssid_transform_from_entry (GBinding *binding,
|
|||
text = g_value_get_string (source_value);
|
||||
|
||||
old_ssid = nm_setting_wireless_get_ssid (s_wireless);
|
||||
utf8 = nm_utils_ssid_to_utf8 (g_bytes_get_data (old_ssid, NULL),
|
||||
g_bytes_get_size (old_ssid));
|
||||
if (old_ssid)
|
||||
utf8 = nm_utils_ssid_to_utf8 (g_bytes_get_data (old_ssid, NULL),
|
||||
g_bytes_get_size (old_ssid));
|
||||
else
|
||||
utf8 = g_strdup ("");
|
||||
|
||||
if (!g_strcmp0 (text, utf8)) {
|
||||
g_free (utf8);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue