]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: btf: Fix vsnprintf return value check
authorFedor Tokarev <ftokarev@gmail.com>
Mon, 11 Jul 2022 21:13:17 +0000 (23:13 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Fri, 29 Jul 2022 16:57:14 +0000 (09:57 -0700)
commit0399b39226d0f6993cb3dbf095f9b3b623fc49d4
tree699ec084b200525aa749648350154a45a154e4f9
parentdb70c23e70eff7bd9e23c253069c4467de8375fa
bpf: btf: Fix vsnprintf return value check

vsnprintf returns the number of characters which would have been written if
enough space had been available, excluding the terminating null byte. Thus,
the return value of 'len_left' means that the last character has been
dropped.

Signed-off-by: Fedor Tokarev <ftokarev@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Alan Maguire <alan.maguire@oracle.com>
Link: https://lore.kernel.org/bpf/20220711211317.GA1143610@laptop
kernel/bpf/btf.c