aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap/wpa_auth_ft.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2013-01-01 18:35:10 (GMT)
committerJouni Malinen <j@w1.fi>2013-01-12 15:51:53 (GMT)
commit5bfc46bb559eb1e143334e7591c4ef3cf05a2ca8 (patch)
tree9e4efe7254949f1b8e582a768c9334b5983b5f7c /src/ap/wpa_auth_ft.c
parentde61795e7c491f3e4a3e82297dabb9e5ac96d9c9 (diff)
downloadhostap-5bfc46bb559eb1e143334e7591c4ef3cf05a2ca8.zip
hostap-5bfc46bb559eb1e143334e7591c4ef3cf05a2ca8.tar.gz
hostap-5bfc46bb559eb1e143334e7591c4ef3cf05a2ca8.tar.bz2
Extra validation to keep static analyzers happy
Use of two variables to track bounds checking seems to be a bit too much for some static analyzers, so add an extra condition for buffer padding to avoid incorrect warnings. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/ap/wpa_auth_ft.c')
-rw-r--r--src/ap/wpa_auth_ft.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ap/wpa_auth_ft.c b/src/ap/wpa_auth_ft.c
index 48bf79b..ccb3f82 100644
--- a/src/ap/wpa_auth_ft.c
+++ b/src/ap/wpa_auth_ft.c
@@ -416,7 +416,7 @@ static u8 * wpa_ft_gtk_subelem(struct wpa_state_machine *sm, size_t *len)
pad_len = 8 - pad_len;
if (key_len + pad_len < 16)
pad_len += 8;
- if (pad_len) {
+ if (pad_len && key_len < sizeof(keybuf)) {
os_memcpy(keybuf, gsm->GTK[gsm->GN - 1], key_len);
os_memset(keybuf + key_len, 0, pad_len);
keybuf[key_len] = 0xdd;