The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=4449cf28a3152cf6e87a45176ae15ae250e543de

commit 4449cf28a3152cf6e87a45176ae15ae250e543de
Author:     John Baldwin <j...@freebsd.org>
AuthorDate: 2025-04-11 14:02:09 +0000
Commit:     John Baldwin <j...@freebsd.org>
CommitDate: 2025-04-11 14:02:09 +0000

    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
---
 usr.sbin/ctld/ctld.cc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/usr.sbin/ctld/ctld.cc b/usr.sbin/ctld/ctld.cc
index bc794815830c..ff23db6c5293 100644
--- a/usr.sbin/ctld/ctld.cc
+++ b/usr.sbin/ctld/ctld.cc
@@ -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;

Reply via email to