Re: [PATCH] greybus: fw-management: Replace strncpy with strlcpy

2017-02-21 Thread Tobin Harding
On Thu, Feb 16, 2017, at 03:03 PM, Viresh Kumar wrote: > Hi Tobin, > > On Wed, Feb 15, 2017 at 5:39 AM, Tobin C. Harding wrote: > > Greybus currently uses strncpy() coupled with a check for '\0' on the > > last byte of various buffers. strncpy() is passed size parameter equal > > to the size of t

Re: [PATCH] greybus: fw-management: Replace strncpy with strlcpy

2017-02-15 Thread Viresh Kumar
Hi Tobin, On Wed, Feb 15, 2017 at 5:39 AM, Tobin C. Harding wrote: > Greybus currently uses strncpy() coupled with a check for '\0' on the > last byte of various buffers. strncpy() is passed size parameter equal > to the size of the buffer in all instances. If the source string is > larger than t

Re: [PATCH] greybus: fw-management: Replace strncpy with strlcpy

2017-02-15 Thread Bryan O'Donoghue
On 15/02/17 00:09, Tobin C. Harding wrote: > Greybus currently uses strncpy() coupled with a check for '\0' on the > last byte of various buffers. strncpy() is passed size parameter equal > to the size of the buffer in all instances. If the source string is > larger than the destination buffer the

[PATCH] greybus: fw-management: Replace strncpy with strlcpy

2017-02-14 Thread Tobin C. Harding
Greybus currently uses strncpy() coupled with a check for '\0' on the last byte of various buffers. strncpy() is passed size parameter equal to the size of the buffer in all instances. If the source string is larger than the destination buffer the check catches this and, after logging the error, re