Re: [PATCH] s390/sclp: replace deprecated strncpy with strtomem

2023-10-25 Thread Vasily Gorbik
On Mon, Oct 23, 2023 at 07:14:49PM +, Justin Stitt wrote: > Let's move away from using strncpy() as it is deprecated [1]. > > Instead use strtomem() as `e.id` is already marked as nonstring: > | char id[4] __nonstring; > > We don't need strtomem_pad() because `e` is already memset to 0

Re: [PATCH] s390/sclp: replace deprecated strncpy with strtomem

2023-10-24 Thread Kees Cook
On Tue, Oct 24, 2023 at 04:46:04PM -0700, Kees Cook wrote: > > Instead use strtomem() as `e.id` is already marked as nonstring: > > | char id[4] __nonstring; > > I'm surprised the compiler didn't complain about this -- I thought that > was the point of the __nonstring attribute: to diagnose

Re: [PATCH] s390/sclp: replace deprecated strncpy with strtomem

2023-10-24 Thread Kees Cook
On Mon, Oct 23, 2023 at 07:14:49PM +, Justin Stitt wrote: > Let's move away from using strncpy() as it is deprecated [1]. > > Instead use strtomem() as `e.id` is already marked as nonstring: > | char id[4] __nonstring; I'm surprised the compiler didn't complain about this -- I thought t

[PATCH] s390/sclp: replace deprecated strncpy with strtomem

2023-10-23 Thread Justin Stitt
Let's move away from using strncpy() as it is deprecated [1]. Instead use strtomem() as `e.id` is already marked as nonstring: | char id[4] __nonstring; We don't need strtomem_pad() because `e` is already memset to 0 -- rendering any additional NUL-padding useless. Link: https://www.kerne