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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user