aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-12-27 10:00:26 (GMT)
committerJouni Malinen <j@w1.fi>2016-12-27 10:02:17 (GMT)
commitf78402acea7836540b916cf9053ae0e02d290301 (patch)
tree679e025273e936a1c2caff97ec2585df0c315799 /hostapd
parente0ba7efe52ffbd764c15ccd551c8a335cff2684a (diff)
downloadhostap-f78402acea7836540b916cf9053ae0e02d290301.zip
hostap-f78402acea7836540b916cf9053ae0e02d290301.tar.gz
hostap-f78402acea7836540b916cf9053ae0e02d290301.tar.bz2
hostapd: Do not update rejected wep_key_len_broadcast
Previously, update command with invalid value got rejected, but the actual configuration data was updated anyway. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'hostapd')
-rw-r--r--hostapd/config_file.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hostapd/config_file.c b/hostapd/config_file.c
index 34409ae..dc062ff 100644
--- a/hostapd/config_file.c
+++ b/hostapd/config_file.c
@@ -2294,15 +2294,15 @@ static int hostapd_config_fill(struct hostapd_config *conf,
os_free(bss->erp_domain);
bss->erp_domain = os_strdup(pos);
} else if (os_strcmp(buf, "wep_key_len_broadcast") == 0) {
- bss->default_wep_key_len = atoi(pos);
- if (bss->default_wep_key_len > 13) {
- wpa_printf(MSG_ERROR, "Line %d: invalid WEP key len %lu (= %lu bits)",
- line,
- (unsigned long) bss->default_wep_key_len,
- (unsigned long)
- bss->default_wep_key_len * 8);
+ int val = atoi(pos);
+
+ if (val < 0 || val > 13) {
+ wpa_printf(MSG_ERROR,
+ "Line %d: invalid WEP key len %d (= %d bits)",
+ line, val, val * 8);
return 1;
}
+ bss->default_wep_key_len = val;
} else if (os_strcmp(buf, "wep_key_len_unicast") == 0) {
bss->individual_wep_key_len = atoi(pos);
if (bss->individual_wep_key_len < 0 ||