Re: [PATCH] gpiolib: cdev: switch from kstrdup() to kstrndup()

2020-10-07 Thread Linus Walleij
On Mon, Oct 5, 2020 at 9:03 AM Kent Gibson 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 > arra

[PATCH] gpiolib: cdev: switch from kstrdup() to kstrndup()

2020-10-05 Thread Kent Gibson
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