From dea69a12aa8bf4ed688ae65297c8835e53d31d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Sat, 11 Sep 2021 14:26:03 +0100 Subject: [PATCH] Small sanity check in wildcard tag matching code. --- src/dhcp-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dhcp-common.c b/src/dhcp-common.c index 1f91ca0..69e8d38 100644 --- a/src/dhcp-common.c +++ b/src/dhcp-common.c @@ -88,7 +88,7 @@ int match_netid_wild(struct dhcp_netid *check, struct dhcp_netid *pool) for (; check; check = check->next) { const int check_len = strlen(check->net); - const int is_wc = (check->net[check_len - 1] == '*'); + const int is_wc = (check_len > 0 && check->net[check_len - 1] == '*'); /* '#' for not is for backwards compat. */ if (check->net[0] != '!' && check->net[0] != '#')