On Sun, Jun 07, 2020 at 01:03:45PM +, David Laight wrote:
> From: Herbert Xu
> > Sent: 05 June 2020 13:17
> ...
> > Better yet use strscpy which will even return an error for you.
>
> It really ought to return the buffer length on truncation.
> Then you can loop:
> while(...)
>
From: Herbert Xu
> Sent: 05 June 2020 13:17
...
> Better yet use strscpy which will even return an error for you.
It really ought to return the buffer length on truncation.
Then you can loop:
while(...)
buf += strxxxcpy(buf, src, buf_end - buf);
and only check right at the
On 2020/6/5 下午11:49, Eric Biggers wrote:
On Fri, Jun 05, 2020 at 11:26:20PM +0800, Zhangfei Gao wrote:
On 2020/6/5 下午8:17, Herbert Xu wrote:
On Fri, Jun 05, 2020 at 05:34:32PM +0800, Zhangfei Gao wrote:
Will add a check after the copy.
strlcpy(interface.name, pdev->driver->name,
On Fri, Jun 05, 2020 at 11:26:20PM +0800, Zhangfei Gao wrote:
>
>
> On 2020/6/5 下午8:17, Herbert Xu wrote:
> > On Fri, Jun 05, 2020 at 05:34:32PM +0800, Zhangfei Gao wrote:
> > > Will add a check after the copy.
> > >
> > > strlcpy(interface.name, pdev->driver->name,
> > > sizeof(interf
On 2020/6/5 下午8:17, Herbert Xu wrote:
On Fri, Jun 05, 2020 at 05:34:32PM +0800, Zhangfei Gao wrote:
Will add a check after the copy.
strlcpy(interface.name, pdev->driver->name, sizeof(interface.name));
if (strlen(pdev->driver->name) != strlen(interface.name))
On Fri, Jun 05, 2020 at 05:34:32PM +0800, Zhangfei Gao wrote:
> Will add a check after the copy.
>
> strlcpy(interface.name, pdev->driver->name, sizeof(interface.name));
> if (strlen(pdev->driver->name) != strlen(interface.name))
> return -EINVAL;
You don't need to
On 2020/6/4 下午2:50, Herbert Xu wrote:
On Thu, Jun 04, 2020 at 02:44:16PM +0800, Zhangfei Gao wrote:
I think it is fine.
1. Currently the name size is 64, bigger enough.
Simply grep in driver name, 64 should be enough.
We can make it larger when there is a request.
2. it does not matter what t
On 2020/6/4 14:50, Herbert Xu wrote:
> On Thu, Jun 04, 2020 at 02:44:16PM +0800, Zhangfei Gao wrote:
>>
>> I think it is fine.
>> 1. Currently the name size is 64, bigger enough.
>> Simply grep in driver name, 64 should be enough.
>> We can make it larger when there is a request.
>> 2. it does not
On Thu, Jun 04, 2020 at 02:44:16PM +0800, Zhangfei Gao wrote:
>
> I think it is fine.
> 1. Currently the name size is 64, bigger enough.
> Simply grep in driver name, 64 should be enough.
> We can make it larger when there is a request.
> 2. it does not matter what the name is, since it is just an
On 2020/6/4 下午2:18, Herbert Xu wrote:
On Thu, Jun 04, 2020 at 02:10:37PM +0800, Zhangfei Gao wrote:
Should this even allow truncation? Perhaps it'd be better to fail
in case of an overrun?
I think we do not need consider overrun, since it at most copy size-1 bytes
to dest.
From the manual:
On Thu, Jun 04, 2020 at 02:10:37PM +0800, Zhangfei Gao wrote:
>
> > Should this even allow truncation? Perhaps it'd be better to fail
> > in case of an overrun?
> I think we do not need consider overrun, since it at most copy size-1 bytes
> to dest.
> From the manual: strlcpy()
> This funct
On 2020/6/4 上午11:39, Herbert Xu wrote:
On Thu, Jun 04, 2020 at 11:32:04AM +0800, Zhangfei Gao wrote:
Use strlcpy to fix the warning
warning: 'strncpy' specified bound 64 equals destination size
[-Wstringop-truncation]
Reported-by: kernel test robot
Signed-off-by: Zhangfei Gao
---
On Thu, Jun 04, 2020 at 11:32:04AM +0800, Zhangfei Gao wrote:
> Use strlcpy to fix the warning
> warning: 'strncpy' specified bound 64 equals destination size
> [-Wstringop-truncation]
>
> Reported-by: kernel test robot
> Signed-off-by: Zhangfei Gao
> ---
> drivers/crypto/hisilicon/qm.
Use strlcpy to fix the warning
warning: 'strncpy' specified bound 64 equals destination size
[-Wstringop-truncation]
Reported-by: kernel test robot
Signed-off-by: Zhangfei Gao
---
drivers/crypto/hisilicon/qm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/
14 matches
Mail list logo