Silence gcc 4.3.0 warnings about invalid array indexes

This commit is contained in:
Jouni Malinen 2008-03-12 09:33:18 +02:00
parent 502a293e30
commit ccfab35a6a
2 changed files with 5 additions and 4 deletions

View file

@ -87,8 +87,8 @@
#define WPA_OUI_TYPE RSN_SELECTOR(0x00, 0x50, 0xf2, 1) #define WPA_OUI_TYPE RSN_SELECTOR(0x00, 0x50, 0xf2, 1)
#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((a), (val)) #define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *) (a), (val))
#define RSN_SELECTOR_GET(a) WPA_GET_BE32((a)) #define RSN_SELECTOR_GET(a) WPA_GET_BE32((const u8 *) (a))
#define RSN_NUM_REPLAY_COUNTERS_1 0 #define RSN_NUM_REPLAY_COUNTERS_1 0
#define RSN_NUM_REPLAY_COUNTERS_2 1 #define RSN_NUM_REPLAY_COUNTERS_2 1

View file

@ -121,7 +121,7 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
const u8 *kck, const u8 *target_ap) const u8 *kck, const u8 *target_ap)
{ {
size_t buf_len; size_t buf_len;
u8 *buf, *pos, *ftie_len; u8 *buf, *pos, *ftie_len, *ftie_pos;
struct rsn_mdie *mdie; struct rsn_mdie *mdie;
struct rsn_ftie *ftie; struct rsn_ftie *ftie;
struct rsn_ie_hdr *rsnie; struct rsn_ie_hdr *rsnie;
@ -226,6 +226,7 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
mdie->ft_capab = 0; /* FIX: copy from the target AP's MDIE */ mdie->ft_capab = 0; /* FIX: copy from the target AP's MDIE */
/* FTIE[SNonce, R0KH-ID] */ /* FTIE[SNonce, R0KH-ID] */
ftie_pos = pos;
*pos++ = WLAN_EID_FAST_BSS_TRANSITION; *pos++ = WLAN_EID_FAST_BSS_TRANSITION;
ftie_len = pos++; ftie_len = pos++;
ftie = (struct rsn_ftie *) pos; ftie = (struct rsn_ftie *) pos;
@ -255,7 +256,7 @@ static u8 * wpa_ft_gen_req_ies(struct wpa_sm *sm, size_t *len,
ftie->mic_control[1] = 3; /* Information element count */ ftie->mic_control[1] = 3; /* Information element count */
if (wpa_ft_mic(kck, sm->own_addr, target_ap, 5, if (wpa_ft_mic(kck, sm->own_addr, target_ap, 5,
((u8 *) mdie) - 2, 2 + sizeof(*mdie), ((u8 *) mdie) - 2, 2 + sizeof(*mdie),
((u8 *) ftie) - 2, 2 + *ftie_len, ftie_pos, 2 + *ftie_len,
(u8 *) rsnie, 2 + rsnie->len, NULL, 0, (u8 *) rsnie, 2 + rsnie->len, NULL, 0,
ftie->mic) < 0) { ftie->mic) < 0) {
wpa_printf(MSG_INFO, "FT: Failed to calculate MIC"); wpa_printf(MSG_INFO, "FT: Failed to calculate MIC");