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

index 5373b778d27a3719b0de0c2ca144e6d729d72258..22889ec270c36874fccd4a98fc43b0dd52f84e33 100644 (file)
--- a/RELNOTES
+++ b/RELNOTES
@@ -163,7 +163,12 @@ 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.3.3b1
+
 - None
 
                        Changes since 4.3.2
index 39d4f45d75264dd277171c6827a90c8bf498db7d..0bb140ee88de1bc5df9e995eed3102b46e13fb19 100644 (file)
@@ -3,7 +3,7 @@
    BPF socket interface code, originally contributed by Archie Cobbs. */
 
 /*
- * Copyright (c) 2009,2012-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
  *
@@ -200,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);
@@ -285,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.");