Skip to content

Commit

Permalink
stop networkContainsSubnet from mutating original bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
demskie committed May 15, 2019
1 parent 4ba9df0 commit baa1675
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ export function networkContainsSubnet(net: Network, subnet: Network, throwErrors
const netBytesEnd = duplicateAddress(net.bytes);
if (!increaseAddressWithCIDR(netBytesEnd, net.cidr, throwErrors)) return false;
const subnetBytesEnd = duplicateAddress(subnet.bytes);
if (!increaseAddressWithCIDR(subnet.bytes, subnet.cidr, throwErrors)) return false;
if (!increaseAddressWithCIDR(subnetBytesEnd, subnet.cidr, throwErrors)) return false;
if (compareAddresses(netBytesEnd, subnetBytesEnd) < 0) return false;
return true;
}
Expand Down

0 comments on commit baa1675

Please sign in to comment.