summaryrefslogtreecommitdiff
path: root/sysdep/bsd
diff options
context:
space:
mode:
authorStefan Haller <stefan.haller@stha.de>2021-04-19 15:06:42 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2021-04-19 15:06:42 +0200
commita7c9515ebc88c42f26ce97255c98b2e61ad52934 (patch)
tree876837ea43430ca7dec2765758dca269593b18e0 /sysdep/bsd
parent9c41e1ca3e93d4498eaa085139caf1545e08c1d8 (diff)
BSD: Fix invalid pointer derefence in logging code
For logging purposes a stack allocated net_addr struct was passed by value as vararg (instead of the expected pointer). This resulted in a segfault when the specific error condition got logged.
Diffstat (limited to 'sysdep/bsd')
-rw-r--r--sysdep/bsd/krt-sock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index c2faa23d..ea0cc4d9 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -453,7 +453,7 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
net_fill_ip4(&ndst, ipa_to_ip4(idst), pxlen);
if ((flags & RTF_GATEWAY) && ipa_zero(igate))
- { log(L_ERR "%s (%N) - missing gateway", errmsg, ndst); return; }
+ { log(L_ERR "%s (%N) - missing gateway", errmsg, &ndst); return; }
u32 self_mask = RTF_PROTO1;
u32 alien_mask = RTF_STATIC | RTF_PROTO1 | RTF_GATEWAY;