aboutsummaryrefslogtreecommitdiffstats
path: root/src/wps
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2015-04-07 10:22:49 (GMT)
committerJouni Malinen <j@w1.fi>2015-04-22 08:44:19 (GMT)
commit5a041acc0a71fe479de3b87338b0c7126ea7f486 (patch)
treee62406887b3e6b724a48ba1b8400122ab35f6e01 /src/wps
parentd6c3067d3216cd195f837f51baa82cb51856e095 (diff)
downloadhostap-5a041acc0a71fe479de3b87338b0c7126ea7f486.zip
hostap-5a041acc0a71fe479de3b87338b0c7126ea7f486.tar.gz
hostap-5a041acc0a71fe479de3b87338b0c7126ea7f486.tar.bz2
WPS: Ignore too long SSID attribute
While it looks like all the users of this parsed attribute were able to handle longer SSID values, there is no valid use case for these and to avoid any potential future issues, enforce maximum length (32 bytes) on the SSID during parsing. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'src/wps')
-rw-r--r--src/wps/wps_attr_parse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wps/wps_attr_parse.c b/src/wps/wps_attr_parse.c
index 5031f2e..2feeb11 100644
--- a/src/wps/wps_attr_parse.c
+++ b/src/wps/wps_attr_parse.c
@@ -491,6 +491,11 @@ static int wps_set_attr(struct wps_parse_attr *attr, u16 type,
attr->num_cred++;
break;
case ATTR_SSID:
+ if (len > SSID_MAX_LEN) {
+ wpa_printf(MSG_DEBUG,
+ "WPS: Ignore too long SSID (len=%u)", len);
+ break;
+ }
attr->ssid = pos;
attr->ssid_len = len;
break;