lkml.org 
[lkml]   [2023]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/8] Spi: sprd-adi: Getting panic reason before reboot
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.
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2023-08-15 15:24    [W:0.951 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site