lkml.org 
[lkml]   [2020]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] gpiolib: cdev: switch from kstrdup() to kstrndup()
On Mon, Oct 5, 2020 at 9:03 AM Kent Gibson <warthog618@gmail.com> wrote:

> Use kstrndup() to copy line labels from the userspace provided char
> array, rather than ensuring the char array contains a null terminator
> and using kstrdup().
>
> Note that the length provided to kstrndup() still assumes that the char
> array does contain a null terminator, so the maximum string length is one
> less than the array. This is consistent with the previous behaviour.
>
> Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> Signed-off-by: Kent Gibson <warthog618@gmail.com>

General good practice! Patch applied.

Yours,
Linus Walleij

\
 
 \ /
  Last update: 2020-10-07 11:32    [W:0.033 / U:2.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site