Commit f340c44f authored by Jiří Klimeš's avatar Jiří Klimeš

ifcfg-rh: fix an assertion failure and read-after-free error for invalid MACs

parent 6187b850
......@@ -176,9 +176,9 @@ read_mac_address (shvarFile *ifcfg, const char *key, GByteArray **array, GError
mac = ether_aton (value);
if (!mac) {
g_free (value);
g_set_error (error, IFCFG_PLUGIN_ERROR, 0,
"%s: the MAC address '%s' was invalid.", key, value);
g_free (value);
return FALSE;
}
......@@ -2769,6 +2769,9 @@ make_wireless_setting (shvarFile *ifcfg,
g_object_set (s_wireless, NM_SETTING_WIRELESS_CLONED_MAC_ADDRESS, array, NULL);
g_byte_array_free (array, TRUE);
}
} else {
PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: %s", (*error)->message);
g_clear_error (error);
}
value = svGetValue (ifcfg, "ESSID", TRUE);
......@@ -3161,6 +3164,9 @@ make_wired_setting (shvarFile *ifcfg,
g_object_set (s_wired, NM_SETTING_WIRED_CLONED_MAC_ADDRESS, mac, NULL);
g_byte_array_free (mac, TRUE);
}
} else {
PLUGIN_WARN (IFCFG_PLUGIN_NAME, " warning: %s", (*error)->message);
g_clear_error (error);
}
value = svGetValue (ifcfg, "KEY_MGMT", FALSE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment