Search Linux Wireless

Re: [PATCH 1/2] [v2] wifi: mwifiex: avoid strlcpy() and use strscpy() where appropriate

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

 



On Wed, Jun 21, 2023 at 11:08:46AM +0300, Dmitry Antipov wrote:
> On 6/20/23 19:08, Brian Norris wrote:
> 
> > I'm not sure how a compile-time constant makes this "unsafe" at all, but
> > if you feel the need to change this, then sure, this works too.
> 
> The only reason is to avoid strlcpy() which is now considered deprecated.

Sure, OK.

> > FWIW, this 'firmware' pointer is all derived from compile-time constants
> > too. So the commit messages seems misleading ("all other calls [...]
> > should be safe" --> well, *all* calls are safe).
> 
> Indeed. So I think we can stay with strcpy() everywhere except strlcpy() to strscpy() replacement
> (just to follow https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy rather than
> to fix something).

That works too. It's cool to drop stcrpy() anyway though, since it's
really just a feature of a poor language (C) that we have to reason
about whether any given string operation is "safe" or not. I was just
noting that your commit message reasoning was slightly off.

Brian



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux