diff options
author | Thomas Haller <thaller@redhat.com> | 2014-08-13 01:46:53 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-08-19 00:13:11 +0200 |
commit | 25aa0a0705b2acb01c24d974a66c507cdad91720 (patch) | |
tree | 122410ec15659e2e3d3fc3f5b5913019b8c4a224 /libnm-util/nm-setting-adsl.c | |
parent | 645ab39bb65eabf3d75871e4f86c240a29363199 (diff) | |
download | NetworkManager-25aa0a0705b2acb01c24d974a66c507cdad91720.tar.gz |
libnm-core: fix crash in NMSettingAdsl:verify()
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'libnm-util/nm-setting-adsl.c')
-rw-r--r-- | libnm-util/nm-setting-adsl.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libnm-util/nm-setting-adsl.c b/libnm-util/nm-setting-adsl.c index 0a8eba7c0d..76fa63b910 100644 --- a/libnm-util/nm-setting-adsl.c +++ b/libnm-util/nm-setting-adsl.c @@ -226,20 +226,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, |