On Tue, Aug 15, 2023 at 10:34:19AM +0800, Jiansheng Wu wrote: > + if (strlen(reason) < PANIC_REASON_LEN_MAX) > + memcpy(panic_reason, reason, strlen(reason)); > + else > + memcpy(panic_reason, reason, PANIC_REASON_LEN_MAX); There's length limited strcpy() variants for this.
Attachment:
signature.asc
Description: PGP signature