Thread (21 messages) 21 messages, 5 authors, 2024-07-10

Re: [PATCH v2 4/4] EDAC/mce_amd: Add support for FRU Text in MCA

From: Naik, Avadhut <hidden>
Date: 2024-07-09 06:29:19
Also in: linux-acpi, linux-edac, lkml


On 6/26/2024 13:20, Borislav Petkov wrote:
On Wed, Jun 26, 2024 at 01:00:30PM -0500, Naik, Avadhut wrote:
quoted
quoted
Why are you clearing it if you're overwriting it immediately?
Since its a local variable, wanted to ensure that the memory is zeroed out to prevent
any issues with the %s specifier, used later on.
What issues?
Its a locally defined string of 17 bytes. We are doing memcpy() into the first 16 bytes.
Don't we need to ensure that it is NULL-terminated to prevent undefined behavior when its
given to pr_emerg()? Am I missing something here?
quoted
Would you recommend removing that and using initializer instead for the string?
I'd recommend looking at what the code does and then really thinking whether
that makes any sense.
-- 
Thanks,
Avadhut Naik
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help