ctld: Require a mask if / is specified in an initiator portal

If the / separator in a portal string is the last character in the
string, treat the portal as invalid.

Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D49648
This commit is contained in:
John Baldwin
2025-04-11 10:02:09 -04:00
parent f3eb1514ce
commit 4449cf28a3
+2
View File
@@ -349,6 +349,8 @@ auth_portal_new(struct auth_group *ag, const char *portal)
dm = 32;
}
if (mask != NULL) {
if (mask[0] == '\0')
goto error;
m = strtol(mask, &tmp, 0);
if (m < 0 || m > dm || tmp[0] != 0)
goto error;