942859d969
snprintf() should be given the full buffer size, not one less. And it
guarantees nul-termination, so doing it manually afterwards is
pointless.
It's even potentially harmful (though probably not in practice because
CPER_REC_LEN is 256), due to the "return how much would have been
written had the buffer been big enough" semantics. I.e., if the bank
and/or device strings are long enough that the "DIMM location ..."
output gets truncated, writing to msg[n] is a buffer overflow.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Fixes:
|
||
---|---|---|
.. | ||
libstub | ||
test | ||
Kconfig | ||
Makefile | ||
apple-properties.c | ||
arm-runtime.c | ||
capsule-loader.c | ||
capsule.c | ||
cper-arm.c | ||
cper-x86.c | ||
cper.c | ||
dev-path-parser.c | ||
earlycon.c | ||
efi-bgrt.c | ||
efi-init.c | ||
efi-pstore.c | ||
efi.c | ||
efibc.c | ||
efivars.c | ||
embedded-firmware.c | ||
esrt.c | ||
fake_mem.c | ||
fake_mem.h | ||
fdtparams.c | ||
memattr.c | ||
memmap.c | ||
mokvar-table.c | ||
rci2-table.c | ||
reboot.c | ||
riscv-runtime.c | ||
runtime-map.c | ||
runtime-wrappers.c | ||
tpm.c | ||
vars.c | ||
x86_fake_mem.c |