summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2009-12-29 14:15:51 -0800
committerMarcel Holtmann <marcel@holtmann.org>2009-12-29 14:15:51 -0800
commitfba5d9650a10cc4af8c58c9c49b18373f7fa333a (patch)
tree50eb3ccc9f9b614ec1bcf95a0a238cfc343ef1db
parent3df02dba21e053bfaa3611b1815e94e61e4f1549 (diff)
downloadconnman-fba5d9650a10cc4af8c58c9c49b18373f7fa333a.tar.gz
connman-fba5d9650a10cc4af8c58c9c49b18373f7fa333a.tar.bz2
connman-fba5d9650a10cc4af8c58c9c49b18373f7fa333a.zip
Fix length checks for WPA and RSN IEs
-rw-r--r--plugins/supplicant.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/supplicant.c b/plugins/supplicant.c
index 469e8612..8ae4b670 100644
--- a/plugins/supplicant.c
+++ b/plugins/supplicant.c
@@ -1332,7 +1332,7 @@ static void extract_wpaie(DBusMessageIter *value,
dbus_message_iter_recurse(value, &array);
dbus_message_iter_get_fixed_array(&array, &ie, &ie_len);
- if (ie_len > 0) {
+ if (ie_len > 6) {
result->has_wpa = TRUE;
extract_rsn(result, ie + 6, ie_len - 6);
}
@@ -1348,7 +1348,7 @@ static void extract_rsnie(DBusMessageIter *value,
dbus_message_iter_recurse(value, &array);
dbus_message_iter_get_fixed_array(&array, &ie, &ie_len);
- if (ie_len > 0) {
+ if (ie_len > 2) {
result->has_rsn = TRUE;
extract_rsn(result, ie + 2, ie_len - 2);
}