diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2016-03-14 17:19:38 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2016-03-15 09:00:03 +0100 |
commit | 12063468a3e8d1a70d8cd14a1ea18aa98125c7bb (patch) | |
tree | 91ab857e3ffce620f2527b25e3b7852611cd9059 | |
parent | 4e0968182c7a23404d0f480c32f5c90865177163 (diff) | |
download | NetworkManager-12063468a3e8d1a70d8cd14a1ea18aa98125c7bb.tar.gz |
ifnet: fix a possible NULL dereference
CID 75367 (#1 of 1): Dereference null return value (NULL_RETURNS)
30. dereference: Incrementing a pointer which might be null: pos.
-rw-r--r-- | src/settings/plugins/ifnet/connection_parser.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/settings/plugins/ifnet/connection_parser.c b/src/settings/plugins/ifnet/connection_parser.c index bf8b9a4295..69aa5e9c60 100644 --- a/src/settings/plugins/ifnet/connection_parser.c +++ b/src/settings/plugins/ifnet/connection_parser.c @@ -362,11 +362,17 @@ eap_peap_reader (const char *eap_method, } pos = strchr (*iter, '='); - pos++; - lower = g_ascii_strdown (pos, -1); - g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, lower, - NULL); - g_free (lower); + if (pos && *pos) { + pos++; + lower = g_ascii_strdown (pos, -1); + g_object_set (s_8021x, NM_SETTING_802_1X_PHASE2_AUTH, lower, + NULL); + g_free (lower); + } else { + g_set_error (error, NM_SETTINGS_ERROR, NM_SETTINGS_ERROR_INVALID_CONNECTION, + "No IEEE_8021X_INNER_AUTH_METHOD."); + goto done; + } break; } |