diff options
author | Yonghong Song <yhs@fb.com> | 2019-04-09 17:37:41 -0700 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-04-10 09:46:51 +0200 |
commit | 69a0f9ecef22131982ba328e6b74ebb082bc0992 (patch) | |
tree | 75665c934bb3b1449a290394d33f2b435d16b6f9 /tools/lib/bpf/bpf_prog_linfo.c | |
parent | 6316f78306c171f5a857a2442dbeebc7baab3566 (diff) | |
download | linux-69a0f9ecef22131982ba328e6b74ebb082bc0992.tar.bz2 |
bpf, bpftool: fix a few ubsan warnings
The issue is reported at https://github.com/libbpf/libbpf/issues/28.
Basically, per C standard, for
void *memcpy(void *dest, const void *src, size_t n)
if "dest" or "src" is NULL, regardless of whether "n" is 0 or not,
the result of memcpy is undefined. clang ubsan reported three such
instances in bpf.c with the following pattern:
memcpy(dest, 0, 0).
Although in practice, no known compiler will cause issues when
copy size is 0. Let us still fix the issue to silence ubsan
warnings.
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/lib/bpf/bpf_prog_linfo.c')
0 files changed, 0 insertions, 0 deletions