mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-06 03:28:03 +02:00
libnm: avoid possibly NULL address for NMDeviceVlan calling nm_utils_hwaddr_matches()
This commit is contained in:
parent
7eb054d099
commit
c4198d45e3
1 changed files with 5 additions and 2 deletions
|
|
@ -116,6 +116,7 @@ nm_device_vlan_get_vlan_id (NMDeviceVlan *device)
|
||||||
static gboolean
|
static gboolean
|
||||||
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
connection_compatible (NMDevice *device, NMConnection *connection, GError **error)
|
||||||
{
|
{
|
||||||
|
NMDeviceVlanPrivate *priv;
|
||||||
NMSettingVlan *s_vlan;
|
NMSettingVlan *s_vlan;
|
||||||
NMSettingWired *s_wired;
|
NMSettingWired *s_wired;
|
||||||
const char *setting_hwaddr;
|
const char *setting_hwaddr;
|
||||||
|
|
@ -142,8 +143,10 @@ connection_compatible (NMDevice *device, NMConnection *connection, GError **erro
|
||||||
else
|
else
|
||||||
setting_hwaddr = NULL;
|
setting_hwaddr = NULL;
|
||||||
if (setting_hwaddr) {
|
if (setting_hwaddr) {
|
||||||
if (!nm_utils_hwaddr_matches (setting_hwaddr, -1,
|
priv = NM_DEVICE_VLAN_GET_PRIVATE (device);
|
||||||
NM_DEVICE_VLAN_GET_PRIVATE (device)->hw_address, -1)) {
|
if ( !priv->hw_address
|
||||||
|
|| !nm_utils_hwaddr_matches (setting_hwaddr, -1,
|
||||||
|
priv->hw_address, -1)) {
|
||||||
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
|
g_set_error_literal (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_INCOMPATIBLE_CONNECTION,
|
||||||
_("The hardware address of the device and the connection didn't match."));
|
_("The hardware address of the device and the connection didn't match."));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue