Re: [PATCH v2 bpf-next] libbpf: fix GCC8 warning for strncpy

2019-07-03 Thread Daniel Borkmann
On 07/02/2019 05:16 PM, Andrii Nakryiko wrote: > GCC8 started emitting warning about using strncpy with number of bytes > exactly equal destination size, which is generally unsafe, as can lead > to non-zero terminated string being copied. Use IFNAMSIZ - 1 as number > of bytes to ensure name is alwa

Re: [PATCH v2 bpf-next] libbpf: fix GCC8 warning for strncpy

2019-07-02 Thread Magnus Karlsson
On Tue, Jul 2, 2019 at 6:11 PM Y Song wrote: > > On Tue, Jul 2, 2019 at 8:17 AM Andrii Nakryiko wrote: > > > > GCC8 started emitting warning about using strncpy with number of bytes > > exactly equal destination size, which is generally unsafe, as can lead > > to non-zero terminated string being

Re: [PATCH v2 bpf-next] libbpf: fix GCC8 warning for strncpy

2019-07-02 Thread Y Song
On Tue, Jul 2, 2019 at 8:17 AM Andrii Nakryiko wrote: > > GCC8 started emitting warning about using strncpy with number of bytes > exactly equal destination size, which is generally unsafe, as can lead > to non-zero terminated string being copied. Use IFNAMSIZ - 1 as number > of bytes to ensure na

[PATCH v2 bpf-next] libbpf: fix GCC8 warning for strncpy

2019-07-02 Thread Andrii Nakryiko
GCC8 started emitting warning about using strncpy with number of bytes exactly equal destination size, which is generally unsafe, as can lead to non-zero terminated string being copied. Use IFNAMSIZ - 1 as number of bytes to ensure name is always zero-terminated. Cc: Magnus Karlsson Signed-off-by