diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2021-04-21 21:31:46 +0200 |
---|---|---|
committer | Ard Biesheuvel <ardb@kernel.org> | 2021-08-27 16:01:27 +0200 |
commit | 5eff88dd6b4badd664d7d3b648103d540b390248 (patch) | |
tree | bb18c568b0ef5a82333fd21eace9655ff60ee668 /security | |
parent | Linux 5.14-rc1 (diff) | |
download | linux-5eff88dd6b4badd664d7d3b648103d540b390248.tar.xz linux-5eff88dd6b4badd664d7d3b648103d540b390248.zip |
efi: cper: fix scnprintf() use in cper_mem_err_location()
The last two if-clauses fail to update n, so whatever they might have
written at &msg[n] would be cut off by the final nul-termination.
That nul-termination is redundant; scnprintf(), just like snprintf(),
guarantees a nul-terminated output buffer, provided the buffer size is
positive.
And there's no need to discount one byte from the initial buffer;
vsnprintf() expects to be given the full buffer size - it's not going
to write the nul-terminator one beyond the given (buffer, size) pair.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Diffstat (limited to 'security')
0 files changed, 0 insertions, 0 deletions