lkml.org 
[lkml]   [2019]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH bpf-next v2] libbpf: Fix strncat bounds error in libbpf_prog_type_by_name
On Wed, Oct 23, 2019 at 8:40 AM KP Singh <kpsingh@chromium.org> wrote:
>
> From: KP Singh <kpsingh@google.com>
>
> 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>

Applied. Thanks

\
 
 \ /
  Last update: 2019-10-23 19:19    [W:0.048 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site