Skip to content

Commit 6d0c4b1

Browse files
Rtoaxborkmann
authored andcommitted
libbpf: Poison strlcpy()
Since commit 9fc205b("libbpf: Add sane strncpy alternative and use it internally") introduce libbpf_strlcpy(), thus add strlcpy() to a poison list to prevent accidental use of it. Signed-off-by: Rong Tao <rongtao@cestc.cn> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Stanislav Fomichev <sdf@google.com> Link: https://lore.kernel.org/bpf/tencent_5695A257C4D16B4413036BA1DAACDECB0B07@qq.com
1 parent 6bd4755 commit 6d0c4b1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/lib/bpf/libbpf_internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
/* make sure libbpf doesn't use kernel-only integer typedefs */
2121
#pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64
2222

23-
/* prevent accidental re-addition of reallocarray() */
24-
#pragma GCC poison reallocarray
23+
/* prevent accidental re-addition of reallocarray()/strlcpy() */
24+
#pragma GCC poison reallocarray strlcpy
2525

2626
#include "libbpf.h"
2727
#include "btf.h"

0 commit comments

Comments
 (0)