Search Linux Wireless

Re: [PATCH 5/9] drivers/net/wireless: Correct code taking the size of a pointer

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

 



I have submitted the suggested patch, but I am not sure whether it is 
correct.  Will the memcpy for iv16 be picking up the right two bytes?

julia


On Sun, 13 Dec 2009, Andreas Schwab wrote:

> Julia Lawall <julia@xxxxxxx> writes:
> 
> > diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
> > index eb1e1d0..1e74732 100644
> > --- a/drivers/net/wireless/rt2x00/rt2800lib.c
> > +++ b/drivers/net/wireless/rt2x00/rt2800lib.c
> > @@ -2140,8 +2140,8 @@ static void rt2800_get_tkip_seq(struct ieee80211_hw *hw, u8 hw_key_idx,
> >  	rt2800_register_multiread(rt2x00dev, offset,
> >  				      &iveiv_entry, sizeof(iveiv_entry));
> >  
> > -	memcpy(&iveiv_entry.iv[0], iv16, sizeof(iv16));
> > -	memcpy(&iveiv_entry.iv[4], iv32, sizeof(iv32));
> > +	memcpy(&iveiv_entry.iv[0], iv16, sizeof(*iv16));
> > +	memcpy(&iveiv_entry.iv[4], iv32, sizeof(*iv32));
> 
> That still looks pretty bogus, the memcpy calls are overwriting the
> values written by the previous rt2800_register_multiread call.  Most
> likely the first two arguments need to be swapped.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, schwab@xxxxxxxxxxxxxx
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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