From: Shawn Routhier Date: Wed, 20 Jan 2016 03:10:58 +0000 (-0800) Subject: [v4_1_esv] Correct size for buffer allocation X-Git-Tag: v4_1_esv_r13b1~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb582f947ccebd39bd8e11212452050dc25fa680;p=thirdparty%2Fdhcp.git [v4_1_esv] Correct size for buffer allocation --- diff --git a/RELNOTES b/RELNOTES index c0b64222a..d60a0058e 100644 --- a/RELNOTES +++ b/RELNOTES @@ -151,6 +151,10 @@ by Eric Young (eay@cryptsoft.com). update as an "invalid state transition". [ISC_BUGS #25189] +- Properly allocate memory for a bpf filter. + Thanks to Bill Parker (wp02855 at gmail dot com) who identified this issue. + [ISC-Bugs #41485] + Changes since 4.1-ESV-R12b1 - None diff --git a/common/bpf.c b/common/bpf.c index 4b0433b4d..de33ab13a 100644 --- a/common/bpf.c +++ b/common/bpf.c @@ -3,7 +3,8 @@ BPF socket interface code, originally contributed by Archie Cobbs. */ /* - * Copyright (c) 2004,2007,2009,2014 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2009,2012-2014,2016 by Internet Systems Consortium, Inc. ("ISC") + * Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC") * Copyright (c) 1996-2003 by Internet Software Consortium * * Permission to use, copy, modify, and distribute this software for any @@ -199,7 +200,7 @@ struct bpf_insn dhcp_bpf_filter [] = { }; #if defined (DEC_FDDI) -struct bpf_insn *bpf_fddi_filter; +struct bpf_insn *bpf_fddi_filter = NULL; #endif int dhcp_bpf_filter_len = sizeof dhcp_bpf_filter / sizeof (struct bpf_insn); @@ -284,7 +285,7 @@ void if_register_receive (info) if (ioctl(info -> rfdesc, BIOCGDLT, &link_layer) >= 0 && link_layer == DLT_FDDI) { if (!bpf_fddi_filter) { - bpf_fddi_filter = dmalloc (sizeof bpf_fddi_filter, + bpf_fddi_filter = dmalloc (sizeof dhcp_bpf_filter, MDL); if (!bpf_fddi_filter) log_fatal ("No memory for FDDI filter.");