projects
/
NetworkManager.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4e09681
)
ifnet: fix a possible NULL dereference
author
Lubomir Rintel
<lkundrak@v3.sk>
Mon, 14 Mar 2016 16:19:38 +0000
(17:19 +0100)
committer
Lubomir Rintel
<lkundrak@v3.sk>
Tue, 15 Mar 2016 08:00:03 +0000
(09:00 +0100)
CID 75367 (#1 of 1): Dereference null return value (NULL_RETURNS)
30. dereference: Incrementing a pointer which might be null: pos.
src/settings/plugins/ifnet/connection_parser.c
patch
|
blob
|
history
diff --git
a/src/settings/plugins/ifnet/connection_parser.c
b/src/settings/plugins/ifnet/connection_parser.c
index
bf8b9a4
..
69aa5e9
100644
(file)
--- 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;
}