]> The Tcpdump Group git mirrors - libpcap/commitdiff
rpcapd: fix bogus error message buffer argument.
authorGuy Harris <[email protected]>
Sat, 27 Feb 2021 07:25:57 +0000 (23:25 -0800)
committerGuy Harris <[email protected]>
Mon, 1 Mar 2021 22:47:21 +0000 (14:47 -0800)
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)

rpcapd/daemon.c

index 3bcc7337ff824636ec0812f0fe0192178b10a1c1..e2b20a935e224a95d7f47dadd828b58d81b020cd 100644 (file)
@@ -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);