Parcourir la source

[5364] Avoid null pointer dereference when there is no subnet.

Marcin Siodelski il y a 7 ans
Parent
commit
7be1582119
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/bin/dhcp6/dhcp6_srv.cc

+ 1 - 1
src/bin/dhcp6/dhcp6_srv.cc

@@ -1237,7 +1237,7 @@ Dhcpv6Srv::assignLeases(const Pkt6Ptr& question, Pkt6Ptr& answer,
 
     // Subnet may be modified by the allocation engine, if the initial subnet
     // belongs to a shared network.
-    if (subnet->getID() != ctx.subnet_->getID()) {
+    if (ctx.subnet_ && subnet && (subnet->getID() != ctx.subnet_->getID())) {
         SharedNetwork6Ptr network;
         subnet->getSharedNetwork(network);
         if (network) {