diff options
author | David S. Miller <davem@davemloft.net> | 2011-11-26 15:35:10 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-26 15:35:10 -0500 |
commit | f47398409c140a48dd40faf75a18f7c93504a22e (patch) | |
tree | 7d464439b88ef595b725a49a3f4e9e931b3a9c5a /drivers/net/wireless/airo.c | |
parent | 51b7b1c34e195886e38ee93ff2a8a203745f897f (diff) |
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: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/airo.c')
-rw-r--r-- | drivers/net/wireless/airo.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index ac1176a4f465..1c008c61b95c 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -1418,7 +1418,7 @@ static int encapsulate(struct airo_info *ai ,etherHead *frame, MICBuffer *mic, i | |||
1418 | emmh32_update(&context->seed,frame->da,ETH_ALEN * 2); // DA,SA | 1418 | emmh32_update(&context->seed,frame->da,ETH_ALEN * 2); // DA,SA |
1419 | emmh32_update(&context->seed,(u8*)&mic->typelen,10); // Type/Length and Snap | 1419 | emmh32_update(&context->seed,(u8*)&mic->typelen,10); // Type/Length and Snap |
1420 | emmh32_update(&context->seed,(u8*)&mic->seq,sizeof(mic->seq)); //SEQ | 1420 | emmh32_update(&context->seed,(u8*)&mic->seq,sizeof(mic->seq)); //SEQ |
1421 | emmh32_update(&context->seed,frame->da + ETH_ALEN * 2,payLen); //payload | 1421 | emmh32_update(&context->seed,(u8*)(frame + 1),payLen); //payload |
1422 | emmh32_final(&context->seed, (u8*)&mic->mic); | 1422 | emmh32_final(&context->seed, (u8*)&mic->mic); |
1423 | 1423 | ||
1424 | /* New Type/length ?????????? */ | 1424 | /* New Type/length ?????????? */ |
@@ -1506,7 +1506,7 @@ static int decapsulate(struct airo_info *ai, MICBuffer *mic, etherHead *eth, u16 | |||
1506 | emmh32_update(&context->seed, eth->da, ETH_ALEN*2); | 1506 | emmh32_update(&context->seed, eth->da, ETH_ALEN*2); |
1507 | emmh32_update(&context->seed, (u8 *)&mic->typelen, sizeof(mic->typelen)+sizeof(mic->u.snap)); | 1507 | emmh32_update(&context->seed, (u8 *)&mic->typelen, sizeof(mic->typelen)+sizeof(mic->u.snap)); |
1508 | emmh32_update(&context->seed, (u8 *)&mic->seq,sizeof(mic->seq)); | 1508 | emmh32_update(&context->seed, (u8 *)&mic->seq,sizeof(mic->seq)); |
1509 | emmh32_update(&context->seed, eth->da + ETH_ALEN*2,payLen); | 1509 | emmh32_update(&context->seed, (u8 *)(eth + 1),payLen); |
1510 | //Calculate MIC | 1510 | //Calculate MIC |
1511 | emmh32_final(&context->seed, digest); | 1511 | emmh32_final(&context->seed, digest); |
1512 | 1512 | ||