summaryrefslogtreecommitdiffstats
path: root/lib/if.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2022-02-17 20:07:57 +0100
committerDonald Sharp <sharpd@nvidia.com>2022-02-22 17:02:15 +0100
commit4d7aae38ab5f88421dea48a6f6541f86ce4cd954 (patch)
tree2bad220c91911f9f3d394d544122102802f9253f /lib/if.c
parentMerge pull request #10618 from louis-oui/topo-win-title (diff)
downloadfrr-4d7aae38ab5f88421dea48a6f6541f86ce4cd954.tar.xz
frr-4d7aae38ab5f88421dea48a6f6541f86ce4cd954.zip
lib: Fix possible usage of uninited data
assert when if_lookup_address is passed with a family that is not AF_INET or AF_INET6 as that we are dead in the water and this is a dev escape Signed-off-by: Donald Sharp <sharpd@nvidia.com>
Diffstat (limited to 'lib/if.c')
-rw-r--r--lib/if.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/if.c b/lib/if.c
index a2918b6d7..83fa85ecc 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -490,7 +490,8 @@ struct connected *if_lookup_address(const void *matchaddr, int family,
addr.family = AF_INET6;
addr.u.prefix6 = *((struct in6_addr *)matchaddr);
addr.prefixlen = IPV6_MAX_BITLEN;
- }
+ } else
+ assert(!"Attempted lookup of family not supported");
match = NULL;