From: Guy Harris Date: Sat, 27 Feb 2021 07:25:57 +0000 (-0800) Subject: rpcapd: fix bogus error message buffer argument. X-Git-Tag: libpcap-1.10.1~47 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/0fe1fc02ef9b9f2bf155ae70790cec330e240e2c rpcapd: fix bogus error message buffer argument. Probably a copy-and-pasteo; we were passing the result of pcap_geterr(session->fp), which is the error buffer for the pcap_t being used for the capture, to sock_send(), when we *should* have been using the errbuf variable. Fixes Coverity CID 1472849. (cherry picked from commit aa976ae12ccf81fd5a850e8eb1a8e7a1b5bb5445) --- diff --git a/rpcapd/daemon.c b/rpcapd/daemon.c index 3bcc7337..e2b20a93 100644 --- a/rpcapd/daemon.c +++ b/rpcapd/daemon.c @@ -2421,7 +2421,7 @@ daemon_msg_updatefilter_req(uint8 ver, struct daemon_slpars *pars, // A response is needed, otherwise the other host does not know that everything went well rpcap_createhdr(&header, ver, RPCAP_MSG_UPDATEFILTER_REPLY, 0, 0); - if (sock_send(pars->sockctrl, pars->ssl, (char *) &header, sizeof (struct rpcap_header), pcap_geterr(session->fp), PCAP_ERRBUF_SIZE)) + if (sock_send(pars->sockctrl, pars->ssl, (char *) &header, sizeof (struct rpcap_header), errbuf, PCAP_ERRBUF_SIZE)) { // That failed; log a message and give up. rpcapd_log(LOGPRIO_ERROR, "Send to client failed: %s", errbuf);