]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:param: Check return value of strlower_m() (CID 1598446)
authorJo Sutton <josutton@catalyst.net.nz>
Tue, 11 Jun 2024 03:10:02 +0000 (15:10 +1200)
committerMartin Schwenke <martins@samba.org>
Tue, 2 Jul 2024 03:39:35 +0000 (03:39 +0000)
Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Martin Schwenke <martin@meltin.net>
source3/param/loadparm.c

index 12307846c4816a875b303f6491cd007ad23c3d03..663edb2c653ab95d66536bfda289d0d2724fe162 100644 (file)
@@ -4790,6 +4790,7 @@ const char *lp_dns_hostname(void)
        const char *dns_hostname = lp__dns_hostname();
        const char *dns_domain = lp_dnsdomain();
        char *netbios_name = NULL;
+       bool ok;
 
        if (dns_hostname != NULL && dns_hostname[0] != '\0') {
                return dns_hostname;
@@ -4799,7 +4800,10 @@ const char *lp_dns_hostname(void)
        if (netbios_name == NULL) {
                return NULL;
        }
-       strlower_m(netbios_name);
+       ok = strlower_m(netbios_name);
+       if (!ok) {
+               return NULL;
+       }
 
        /* If it isn't set, try to initialize with [netbios name].[realm] */
        if (dns_domain != NULL && dns_domain[0] != '\0') {