]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2347] subnet null check
authorAndrei Pavel <andrei@isc.org>
Tue, 22 Mar 2022 20:48:48 +0000 (22:48 +0200)
committerAndrei Pavel <andrei@isc.org>
Thu, 24 Mar 2022 17:14:03 +0000 (17:14 +0000)
src/bin/dhcp4/dhcp4_srv.cc

index ea74b135abe6feb75f07a60eaf8958099784cb3b..f5e302d7e4d02d550ad9f3dfed0cc8cf881c0c44 100644 (file)
@@ -2541,7 +2541,7 @@ Dhcpv4Srv::assignLease(Dhcpv4Exchange& ex) {
 
     // Subnet may be modified by the allocation engine, if the initial subnet
     // belongs to a shared network.
-    if (subnet->getID() != ctx->subnet_->getID()) {
+    if (subnet && ctx->subnet_ && subnet->getID() != ctx->subnet_->getID()) {
         SharedNetwork4Ptr network;
         subnet->getSharedNetwork(network);
         LOG_DEBUG(packet4_logger, DBG_DHCP4_BASIC_DATA, DHCP4_SUBNET_DYNAMICALLY_CHANGED)