libnm-util: fix possible crash when IP method is NULL

This commit is contained in:
Jiří Klimeš 2013-07-03 16:46:39 +02:00
parent 7967a6524a
commit b40e5f4aa9
2 changed files with 2 additions and 2 deletions

View file

@ -774,7 +774,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
if (list) {
NMSettingIP6Config *s_ip6 = g_slist_nth_data (list, 0);
if ( s_ip6
&& !strcmp (nm_setting_ip6_config_get_method (s_ip6), NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
&& !g_strcmp0 (nm_setting_ip6_config_get_method (s_ip6), NM_SETTING_IP6_CONFIG_METHOD_IGNORE)) {
g_set_error (error,
NM_SETTING_IP4_CONFIG_ERROR,
NM_SETTING_IP4_CONFIG_ERROR_INVALID_PROPERTY,

View file

@ -758,7 +758,7 @@ verify (NMSetting *setting, GSList *all_settings, GError **error)
if (list) {
NMSettingIP4Config *s_ip4 = g_slist_nth_data (list, 0);
if ( s_ip4
&& !strcmp (nm_setting_ip4_config_get_method (s_ip4), NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
&& !g_strcmp0 (nm_setting_ip4_config_get_method (s_ip4), NM_SETTING_IP4_CONFIG_METHOD_DISABLED)) {
g_set_error (error,
NM_SETTING_IP6_CONFIG_ERROR,
NM_SETTING_IP6_CONFIG_ERROR_INVALID_PROPERTY,