Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-17 Thread Dan Carpenter
On Tue, Jun 17, 2014 at 12:14:18AM +0200, Rickard Strandqvist wrote: > 2014-06-16 21:09 GMT+02:00 Dan Carpenter : > > On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: > >> > >> No one calls U14DriverName() so just delete this function. > > > > Oh. This is a userspace library or

Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-17 Thread Dan Carpenter
On Tue, Jun 17, 2014 at 12:14:18AM +0200, Rickard Strandqvist wrote: 2014-06-16 21:09 GMT+02:00 Dan Carpenter dan.carpen...@oracle.com: On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: No one calls U14DriverName() so just delete this function. Oh. This is a userspace

Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-16 Thread Rickard Strandqvist
2014-06-16 21:09 GMT+02:00 Dan Carpenter : > On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: >> >> No one calls U14DriverName() so just delete this function. > > Oh. This is a userspace library or something? I'm not sure what to do. > > How did you compile test this? Does your

Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-16 Thread Dan Carpenter
On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: > > No one calls U14DriverName() so just delete this function. Oh. This is a userspace library or something? I'm not sure what to do. How did you compile test this? Does your platform even provide strlcpy()? Anyway, don't delete

Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-16 Thread Dan Carpenter
On Sun, Jun 15, 2014 at 12:41:47AM +0200, Rickard Strandqvist wrote: > Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Generally in the kernel we allow strncpy() if people want to use it. Let's not start doing sed replacements of these if it doesn't cause a problem.

Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-16 Thread Dan Carpenter
On Sun, Jun 15, 2014 at 12:41:47AM +0200, Rickard Strandqvist wrote: Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Generally in the kernel we allow strncpy() if people want to use it. Let's not start doing sed replacements of these if it doesn't cause a problem.

Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-16 Thread Dan Carpenter
On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: No one calls U14DriverName() so just delete this function. Oh. This is a userspace library or something? I'm not sure what to do. How did you compile test this? Does your platform even provide strlcpy()? Anyway, don't delete

Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-16 Thread Rickard Strandqvist
2014-06-16 21:09 GMT+02:00 Dan Carpenter dan.carpen...@oracle.com: On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote: No one calls U14DriverName() so just delete this function. Oh. This is a userspace library or something? I'm not sure what to do. How did you compile test

[PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-14 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. There is also a wrong use of strncat, it should have used sizeof - strlen. This was found using a static code analysis program called cppcheck. Rickard Strandqvist (1): staging: ced1401: userspace: use1401.c: Cleaning

[PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-14 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist --- drivers/staging/ced1401/userspace/use1401.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/staging/ced1401/userspace/use1401.c

[PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-14 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist rickard_strandqv...@spectrumdigital.se --- drivers/staging/ced1401/userspace/use1401.c | 10 -- 1 file changed, 4 insertions(+), 6 deletions(-) diff --git

[PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate

2014-06-14 Thread Rickard Strandqvist
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. There is also a wrong use of strncat, it should have used sizeof - strlen. This was found using a static code analysis program called cppcheck. Rickard Strandqvist (1): staging: ced1401: userspace: use1401.c: Cleaning