+936. [bug] fdupont
+ Added an ASSERT to avoid a crash in HooksDhcpv4SrvTest
+ subnet4SelectSimple unit test. Fixed out of bounds vector accesses
+ in perfdhcp (which should not be able to handle links
+ with long (i.e., more than 6 bytes) link-layer addresses).
+ (Trac #3868, git xxx)
+
935. [bug] fdupont
Fixed 3 out of bounds accesses on vectors in DHCP++ code.
(Trac #3854, git de263ad0008f3494a85592f78db1ec662b68e689)
// Server is supposed to report two subnets
ASSERT_EQ(exp_subnets->size(), callback_subnet4collection_->size());
+ ASSERT_GE(exp_subnets->size(), 2);
// Compare that the available subnets are reported as expected
EXPECT_TRUE((*exp_subnets)[0].get() == (*callback_subnet4collection_)[0].get());
HWAddrPtr hwaddr = offer_pkt4->getHWAddr();
std::vector<uint8_t> mac_address(HW_ETHER_LEN, 0);
uint8_t hw_len = hwaddr->hwaddr_.size();
- memcpy(&mac_address[0], &hwaddr->hwaddr_[0], hw_len > 16 ? 16 : hw_len);
+ if (hw_len != 0) {
+ memcpy(&mac_address[0], &hwaddr->hwaddr_[0],
+ hw_len > HW_ETHER_LEN ? HW_ETHER_LEN : hw_len);
+ }
pkt4->writeAt(rand_offset, mac_address.begin(), mac_address.end());
// Set elapsed time.
-// Copyright (C) 2011 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
-// Copyright (C) 2011-2012 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2012, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
-// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012, 2015 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above