]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
netlink socket correct check (#15720)
authorgaurav <gaurav@kargo.com>
Thu, 7 May 2020 07:55:31 +0000 (03:55 -0400)
committerGitHub <noreply@github.com>
Thu, 7 May 2020 07:55:31 +0000 (09:55 +0200)
src/libsystemd/sd-netlink/netlink-socket.c

index aa3c6074cb5850aecf2b4f234c48a86c25424209..8eff8d9924433479c2f2cbac3f3d7de29b6f3bd9 100644 (file)
@@ -283,7 +283,7 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *ret_mcast_gr
                 struct cmsghdr *cmsg;
 
                 cmsg = cmsg_find(&msg, SOL_NETLINK, NETLINK_PKTINFO, CMSG_LEN(sizeof(struct nl_pktinfo)));
-                if (ret_mcast_group)
+                if (cmsg)
                         *ret_mcast_group = ((struct nl_pktinfo*) CMSG_DATA(cmsg))->group;
                 else
                         *ret_mcast_group = 0;