Re: [PATCH v2] x86/tdx: replace deprecated strncpy with strtomem_pad

From: Dave Hansen
Date: Tue Oct 03 2023 - 19:46:58 EST


On 10/3/23 14:54, Justin Stitt wrote:
> Note: Ingo Molnar has some concerns about the comment being out of sync
> [1] but I believe the comment still has a place as we can still
> theoretically copy 64 bytes into our destination buffer without a
> NUL-byte. The extra information about the 65th byte being NUL may serve
> helpful to future travelers of this code. What do we think? I can drop
> the comment in a v3 if needed.

The comment looks fine to me as you've left it. It _might_ be better to
say something like:

Empty space in 'message.str' needs to be overwritten
but does not need to be NULL-terminated.

But I wouldn't bother messing with it any more.

Acked-by: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>

I'll stick this into the tdx branch tomorrow unless someone has stronger
feelings about it.