Search Linux Wireless

[PATCH] airo: Fix array bounds warning when moving packet payload.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---

I was simply tired of seeing these warnings all the time, committed to net-next.

 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 ac1176a..1c008c6 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
 	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->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);
 
 	/*    New Type/length ?????????? */
@@ -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, (u8 *)&mic->typelen, sizeof(mic->typelen)+sizeof(mic->u.snap)); 
 		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
 		emmh32_final(&context->seed, digest);
 	
-- 
1.7.6.4

?τθΊ{.nΗ+?·???­?+%?Λ?±ιέΆ??w?Ί{.nΗ+?·??{±?«zW¬³ψ§Ά?ʽά¨}©?²Ζ zΪ&j:+v?¨ώψ―ω?w?ώ?ΰ2?ή?¨θ­Ϊ&ʼ)ίʽ«aΆΪ??ϋΰzΏδzΉή?ϊ+?ω???έʼj??wθώf



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux