diff options
author | KP Singh <kpsingh@google.com> | 2019-10-23 17:40:38 +0200 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2019-10-23 10:17:28 -0700 |
commit | 58eeb2289ab9bd8acad41a589431bbdbf7622595 (patch) | |
tree | ba8da2fe69745243100e76539a4e926f46e68a36 /kernel/trace | |
parent | e0e4f8e938c48b7c5377661fa3e4738901e6a19b (diff) | |
download | linux-58eeb2289ab9bd8acad41a589431bbdbf7622595.tar.bz2 |
libbpf: Fix strncat bounds error in libbpf_prog_type_by_name
On compiling samples with this change, one gets an error:
error: ‘strncat’ specified bound 118 equals destination size
[-Werror=stringop-truncation]
strncat(dst, name + section_names[i].len,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sizeof(raw_tp_btf_name) - (dst - raw_tp_btf_name));
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
strncat requires the destination to have enough space for the
terminating null byte.
Fixes: f75a697e09137 ("libbpf: Auto-detect btf_id of BTF-based raw_tracepoint")
Signed-off-by: KP Singh <kpsingh@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20191023154038.24075-1-kpsingh@chromium.org
Diffstat (limited to 'kernel/trace')
0 files changed, 0 insertions, 0 deletions