Commit 4ee11356 authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann

libbpf: Fix potential overflow issue

Fix a potential overflow issue found by LGTM analysis, based on Github libbpf
source code.

Fixes: 3d650141 ("bpf: libbpf: Add btf_line_info support to libbpf")
Signed-off-by: default avatarAndrii Nakryiko <andriin@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20191107020855.3834758-3-andriin@fb.com
parent 3dc5e059
...@@ -189,7 +189,7 @@ static void * ...@@ -189,7 +189,7 @@ static void *
alloc_zero_tailing_info(const void *orecord, __u32 cnt, alloc_zero_tailing_info(const void *orecord, __u32 cnt,
__u32 actual_rec_size, __u32 expected_rec_size) __u32 actual_rec_size, __u32 expected_rec_size)
{ {
__u64 info_len = actual_rec_size * cnt; __u64 info_len = (__u64)actual_rec_size * cnt;
void *info, *nrecord; void *info, *nrecord;
int i; int i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment