]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5390] Allow empty MAC in setMac
authorFrancis Dupont <fdupont@isc.org>
Wed, 17 Jan 2018 19:52:28 +0000 (20:52 +0100)
committerFrancis Dupont <fdupont@isc.org>
Wed, 17 Jan 2018 19:52:28 +0000 (20:52 +0100)
src/lib/dhcp/iface_mgr.cc

index 92f90e97968527a3e19d7ca4d81f6e9a9808e9e4..b0e872cf984e6f27fc1736397de21ccdfb2656c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
 //
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -134,7 +134,9 @@ void Iface::setMac(const uint8_t* mac, size_t len) {
                   << MAX_MAC_LEN);
     }
     mac_len_ = len;
-    memcpy(mac_, mac, len);
+    if (len > 0) {
+        memcpy(mac_, mac, len);
+    }
 }
 
 bool Iface::delAddress(const isc::asiolink::IOAddress& addr) {