Commit f4739840 authored by David S. Miller's avatar David S. Miller

airo: Fix array bounds warning when moving packet payload.

drivers/net/wireless/airo.c: In function ‘encapsulate’:
drivers/net/wireless/airo.c:1421:15: warning: array subscript is above array bounds [-Warray-bounds]
drivers/net/wireless/airo.c: In function ‘decapsulate’:
drivers/net/wireless/airo.c:1509:16: warning: array subscript is above array bounds [-Warray-bounds]
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 51b7b1c3
...@@ -1418,7 +1418,7 @@ static int encapsulate(struct airo_info *ai ,etherHead *frame, MICBuffer *mic, i ...@@ -1418,7 +1418,7 @@ static int encapsulate(struct airo_info *ai ,etherHead *frame, MICBuffer *mic, i
emmh32_update(&context->seed,frame->da,ETH_ALEN * 2); // DA,SA emmh32_update(&context->seed,frame->da,ETH_ALEN * 2); // DA,SA
emmh32_update(&context->seed,(u8*)&mic->typelen,10); // Type/Length and Snap emmh32_update(&context->seed,(u8*)&mic->typelen,10); // Type/Length and Snap
emmh32_update(&context->seed,(u8*)&mic->seq,sizeof(mic->seq)); //SEQ emmh32_update(&context->seed,(u8*)&mic->seq,sizeof(mic->seq)); //SEQ
emmh32_update(&context->seed,frame->da + ETH_ALEN * 2,payLen); //payload emmh32_update(&context->seed,(u8*)(frame + 1),payLen); //payload
emmh32_final(&context->seed, (u8*)&mic->mic); emmh32_final(&context->seed, (u8*)&mic->mic);
/* New Type/length ?????????? */ /* New Type/length ?????????? */
...@@ -1506,7 +1506,7 @@ static int decapsulate(struct airo_info *ai, MICBuffer *mic, etherHead *eth, u16 ...@@ -1506,7 +1506,7 @@ static int decapsulate(struct airo_info *ai, MICBuffer *mic, etherHead *eth, u16
emmh32_update(&context->seed, eth->da, ETH_ALEN*2); emmh32_update(&context->seed, eth->da, ETH_ALEN*2);
emmh32_update(&context->seed, (u8 *)&mic->typelen, sizeof(mic->typelen)+sizeof(mic->u.snap)); emmh32_update(&context->seed, (u8 *)&mic->typelen, sizeof(mic->typelen)+sizeof(mic->u.snap));
emmh32_update(&context->seed, (u8 *)&mic->seq,sizeof(mic->seq)); emmh32_update(&context->seed, (u8 *)&mic->seq,sizeof(mic->seq));
emmh32_update(&context->seed, eth->da + ETH_ALEN*2,payLen); emmh32_update(&context->seed, (u8 *)(eth + 1),payLen);
//Calculate MIC //Calculate MIC
emmh32_final(&context->seed, digest); emmh32_final(&context->seed, digest);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment