Re: [PATCH 5/7] scsi: devinfo: replace strncpy and manual pad

2024-02-23 Thread Kees Cook
On Fri, Feb 23, 2024 at 10:23:10PM +, Justin Stitt wrote: > Depending on the state of @compatible, we are going to do different > things with our @to buffer. > > When @compatible is true we want a NUL-term'd and NUL-padded destination > buffer. Conversely, if @compatible is false we just want

[PATCH 5/7] scsi: devinfo: replace strncpy and manual pad

2024-02-23 Thread Justin Stitt
Depending on the state of @compatible, we are going to do different things with our @to buffer. When @compatible is true we want a NUL-term'd and NUL-padded destination buffer. Conversely, if @compatible is false we just want a space-padded destination buffer (no NUL-term required). As per: /**