From 69f6fea86b1f25c881c5b843523aa1e882be0efa Mon Sep 17 00:00:00 2001 From: Pawel Brzezinski Date: Wed, 25 Sep 2019 13:21:18 +0200 Subject: [PATCH] Initialize buffer used for nlh and nfg (cherry picked from commit b14bd6ca7ff945b9b0c0f7ebf885d9f920bc98b3) --- pcap-netfilter-linux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pcap-netfilter-linux.c b/pcap-netfilter-linux.c index 3e66c3b6c0..91bad371b5 100644 --- a/pcap-netfilter-linux.c +++ b/pcap-netfilter-linux.c @@ -316,6 +316,7 @@ static int netfilter_send_config_msg(const pcap_t *handle, uint16_t msg_type, int ack, u_int8_t family, u_int16_t res_id, const struct my_nfattr *mynfa) { char buf[1024] __attribute__ ((aligned)); + memset(buf, 0, sizeof(buf)); struct nlmsghdr *nlh = (struct nlmsghdr *) buf; struct nfgenmsg *nfg = (struct nfgenmsg *) (buf + sizeof(struct nlmsghdr));