]> The Tcpdump Group git mirrors - libpcap/commitdiff
The value you get back from a SIOCGIWPRIV querying how much stuff you
authorguy <guy>
Fri, 4 Apr 2008 20:51:43 +0000 (20:51 +0000)
committerguy <guy>
Fri, 4 Apr 2008 20:51:43 +0000 (20:51 +0000)
get back is in units of struct iw_priv_args, not in units of bytes.

pcap-linux.c

index cb805c88cff6017d63cff1ab42ffb8fc0ef5a0fe..712937733fe988195bb0e48f2c479b3ad681aa78 100644 (file)
@@ -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));