Skip to content

Commit dc0d8f1

Browse files
committed
in_ebpf: Initialize with 0 for preventing garbage address
Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
1 parent f0c81cc commit dc0d8f1

File tree

1 file changed

+7
-1
lines changed
  • plugins/in_ebpf/traces/tcp

1 file changed

+7
-1
lines changed

plugins/in_ebpf/traces/tcp/bpf.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ static __always_inline void parse_sockaddr(const struct sockaddr *addr,
9090
{
9191
sa_family_t family;
9292

93-
if (!addr || !out) {
93+
if (!out) {
94+
return;
95+
}
96+
97+
__builtin_memset(out, 0, sizeof(*out));
98+
99+
if (!addr) {
94100
return;
95101
}
96102

0 commit comments

Comments
 (0)