Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-06 Thread Geert Uytterhoeven
On Thu, Jun 6, 2013 at 1:48 AM, Andrew Morton wrote: >> - strncpy(containerpath, optarg, strlen(optarg) + 1); >> + strlcpy(containerpath, optarg, sizeof(containerpath)); >> break; >> case 'w': >>

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-06 Thread Geert Uytterhoeven
On Thu, Jun 6, 2013 at 1:48 AM, Andrew Morton a...@linux-foundation.org wrote: - strncpy(containerpath, optarg, strlen(optarg) + 1); + strlcpy(containerpath, optarg, sizeof(containerpath)); break; case 'w':

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-05 Thread Kees Cook
On Wed, Jun 5, 2013 at 4:48 PM, Andrew Morton wrote: > On Fri, 31 May 2013 09:18:07 -0700 Kees Cook wrote: > >> Fix various weird constructions of strncpy(dst, src, strlen(src)). Length >> limits should be about the space available in the destination, not >> repurposed as a method to either

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-05 Thread Andrew Morton
On Fri, 31 May 2013 09:18:07 -0700 Kees Cook wrote: > Fix various weird constructions of strncpy(dst, src, strlen(src)). Length > limits should be about the space available in the destination, not > repurposed as a method to either always include or always exclude > a trailing NULL byte. Either

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-05 Thread Andrew Morton
On Fri, 31 May 2013 09:18:07 -0700 Kees Cook keesc...@chromium.org wrote: Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-05 Thread Kees Cook
On Wed, Jun 5, 2013 at 4:48 PM, Andrew Morton a...@linux-foundation.org wrote: On Fri, 31 May 2013 09:18:07 -0700 Kees Cook keesc...@chromium.org wrote: Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-04 Thread Ursula Braun
On Friday, May 31, 2013 09:18:07 AM Kees Cook wrote: > Fix various weird constructions of strncpy(dst, src, strlen(src)). > Length > limits should be about the space available in the destination, not > repurposed as a method to either always include or always exclude > a trailing NULL byte. Either

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-04 Thread Ursula Braun
On Friday, May 31, 2013 09:18:07 AM Kees Cook wrote: Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either the

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-01 Thread Rafael J. Wysocki
On Friday, May 31, 2013 09:18:07 AM Kees Cook wrote: > Fix various weird constructions of strncpy(dst, src, strlen(src)). Length > limits should be about the space available in the destination, not > repurposed as a method to either always include or always exclude > a trailing NULL byte. Either

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-06-01 Thread Rafael J. Wysocki
On Friday, May 31, 2013 09:18:07 AM Kees Cook wrote: Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either the

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-05-31 Thread Greg KH
On Fri, May 31, 2013 at 09:18:07AM -0700, Kees Cook wrote: > Fix various weird constructions of strncpy(dst, src, strlen(src)). Length > limits should be about the space available in the destination, not > repurposed as a method to either always include or always exclude > a trailing NULL byte.

[PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-05-31 Thread Kees Cook
Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either the NULL should always be copied (using strlcpy), or it should

[PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-05-31 Thread Kees Cook
Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either the NULL should always be copied (using strlcpy), or it should

Re: [PATCH] clean up scary strncpy(dst, src, strlen(src)) uses

2013-05-31 Thread Greg KH
On Fri, May 31, 2013 at 09:18:07AM -0700, Kees Cook wrote: Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either