From: guy Date: Fri, 4 Apr 2008 20:51:43 +0000 (+0000) Subject: The value you get back from a SIOCGIWPRIV querying how much stuff you X-Git-Tag: libpcap-1.1.0~347 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/653586c5f7d5241c096eebbb33f4d99557bf6ed3 The value you get back from a SIOCGIWPRIV querying how much stuff you get back is in units of struct iw_priv_args, not in units of bytes. --- diff --git a/pcap-linux.c b/pcap-linux.c index cb805c88..71293773 100644 --- a/pcap-linux.c +++ b/pcap-linux.c @@ -34,7 +34,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.140 2008-04-04 19:37:45 guy Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/libpcap/pcap-linux.c,v 1.141 2008-04-04 20:51:43 guy Exp $ (LBL)"; #endif /* @@ -2319,7 +2319,7 @@ enter_rfmon_mode_wext(pcap_t *handle, int sock_fd, const char *device) "%s: SIOCGIWPRIV: %s", device, pcap_strerror(errno)); return PCAP_ERROR; } - priv = malloc(ireq.u.data.length); + priv = malloc(ireq.u.data.length * sizeof (struct iw_priv_args)); if (priv == NULL) { snprintf(handle->errbuf, PCAP_ERRBUF_SIZE, "malloc: %s", pcap_strerror(errno));