From: Guy Harris Date: Thu, 30 Aug 2018 21:37:21 +0000 (-0700) Subject: Do we *really* need to validate filters in rpcapd? X-Git-Tag: libpcap-1.10-bp~863 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/e7b9c86b70f5f9e614a234cc482d7681dc8a851e?ds=sidebyside Do we *really* need to validate filters in rpcapd? --- diff --git a/rpcapd/daemon.c b/rpcapd/daemon.c index 85aa0f98..e7cef199 100644 --- a/rpcapd/daemon.c +++ b/rpcapd/daemon.c @@ -2020,6 +2020,9 @@ daemon_unpackapplyfilter(SOCKET sockctrl_in, struct session *session, uint32 *pl bf_insn++; } + // + // XXX - pcap_setfilter() should do the validation for us. + // if (bpf_validate(bf_prog.bf_insns, bf_prog.bf_len) == 0) { pcap_snprintf(errmsgbuf, PCAP_ERRBUF_SIZE, "The filter contains bogus instructions");