summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-adsl.c
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-08-13 01:46:53 +0200
committerThomas Haller <thaller@redhat.com>2014-08-19 00:13:11 +0200
commit25aa0a0705b2acb01c24d974a66c507cdad91720 (patch)
tree122410ec15659e2e3d3fc3f5b5913019b8c4a224 /libnm-core/nm-setting-adsl.c
parent645ab39bb65eabf3d75871e4f86c240a29363199 (diff)
downloadNetworkManager-25aa0a0705b2acb01c24d974a66c507cdad91720.tar.gz
libnm-core: fix crash in NMSettingAdsl:verify()
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'libnm-core/nm-setting-adsl.c')
-rw-r--r--libnm-core/nm-setting-adsl.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libnm-core/nm-setting-adsl.c b/libnm-core/nm-setting-adsl.c
index 65bece0277..f6f11e0c54 100644
--- a/libnm-core/nm-setting-adsl.c
+++ b/libnm-core/nm-setting-adsl.c
@@ -225,20 +225,22 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
return FALSE;
}
- if (strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA) &&
- strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE) &&
- strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_IPOATM)) {
+ if ( !priv->protocol
+ || ( strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOA)
+ && strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_PPPOE)
+ && strcmp (priv->protocol, NM_SETTING_ADSL_PROTOCOL_IPOATM))){
g_set_error (error,
NM_SETTING_ADSL_ERROR,
NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,
_("'%s' is not a valid value for the property"),
- priv->protocol);
+ priv->protocol ? priv->protocol : "(null)");
g_prefix_error (error, "%s.%s: ", NM_SETTING_ADSL_SETTING_NAME, NM_SETTING_ADSL_PROTOCOL);
return FALSE;
}
- if (strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_VCMUX) &&
- strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_LLC) ) {
+ if ( priv->encapsulation
+ && ( strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_VCMUX)
+ && strcmp (priv->encapsulation, NM_SETTING_ADSL_ENCAPSULATION_LLC) )) {
g_set_error (error,
NM_SETTING_ADSL_ERROR,
NM_SETTING_ADSL_ERROR_INVALID_PROPERTY,