Search Linux Wireless

Re: Fw: [Bug 51901] New: mac80211/cfg.c:1995: possible bad call to memcpy ?

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

 



On 2012-12-27 8:45 AM, Johannes Berg wrote:
> On Sat, 2012-12-22 at 13:55 -0800, Stephen Hemminger wrote:
> 
>> static int ieee80211_set_mcast_rate(struct wiphy *wiphy, struct net_device
>> *dev,
>>                     int rate[IEEE80211_NUM_BANDS])
>> {
>>     struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
>> 
>>     memcpy(sdata->vif.bss_conf.mcast_rate, rate, sizeof(rate));
> 
> Seems fine to me. If anyone's bothered by the warning, patch welcome,
> but the code is ok since it's an array.
I think the warning is correct and the code needs to be fixed. Since
rate is a function parameter, sizeof(rate) == sizeof(int).
I didn't know about this weird aspect of the C standard either, but I
verified it with a simple user space test program. ;)

- Felix
--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux