sigh, put back buffer overflow fix of 1.1.11 that seems to have

not gone into the 0.9.4 release; don't put it on the vendor branch
so we won't lose it on the next import if they continue to lose it
This commit is contained in:
Sam Leffler 2006-09-04 20:12:45 +00:00
parent d44c9004ff
commit 34c97c7db9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=162020

View File

@ -17,6 +17,8 @@
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*
* $FreeBSD$
*/
#ifndef lint
static const char rcsid[] _U_ =
@ -746,7 +748,7 @@ pcap_open_live(const char *device, int snaplen, int promisc, int to_ms,
u_int i;
int is_ethernet;
bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * bdl.bfl_len + 1);
bdl.bfl_list = (u_int *) malloc(sizeof(u_int) * (bdl.bfl_len + 1));
if (bdl.bfl_list == NULL) {
(void)snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
pcap_strerror(errno));