]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
[v4_1_esv] Correct size for buffer allocation
authorShawn Routhier <sar@isc.org>
Wed, 20 Jan 2016 03:10:58 +0000 (19:10 -0800)
committerShawn Routhier <sar@isc.org>
Wed, 20 Jan 2016 03:10:58 +0000 (19:10 -0800)
RELNOTES
common/bpf.c

index c0b64222a2e2036ee3d64f6762f4763c617b1df9..d60a0058e323aa1556e4d67ad4f9dd41089cafd5 100644 (file)
--- 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
index 4b0433b4d3510de1a37452ad9e9180a60ba77e04..de33ab13a9e83f15fcc07fc35043e7c0eb976a71 100644 (file)
@@ -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.");