We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 93ff5fb commit 2fbf90fCopy full SHA for 2fbf90f
1 file changed
pdns/iputils.hh
@@ -1511,13 +1511,19 @@ public:
1511
//<! Returns "best match" for key_type, which might not be value
1512
[[nodiscard]] node_type* lookup(const key_type& value) const
1513
{
1514
+ if (empty()) {
1515
+ return nullptr;
1516
+ }
1517
uint8_t max_bits = value.getBits();
1518
return lookupImpl(value, max_bits);
1519
}
1520
1521
//<! Perform best match lookup for value, using at most max_bits
1522
[[nodiscard]] node_type* lookup(const ComboAddress& value, int max_bits = 128) const
1523
1524
1525
1526
1527
uint8_t addr_bits = value.getBits();
1528
if (max_bits < 0 || max_bits > addr_bits) {
1529
max_bits = addr_bits;
0 commit comments