From: Jo Sutton Date: Tue, 11 Jun 2024 03:10:02 +0000 (+1200) Subject: s3:param: Check return value of strlower_m() (CID 1598446) X-Git-Tag: tdb-1.4.11~232 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a456f373f74bc09d46a53604a71c0850d74b6d0;p=thirdparty%2Fsamba.git s3:param: Check return value of strlower_m() (CID 1598446) Signed-off-by: Jo Sutton Reviewed-by: Martin Schwenke --- diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 12307846c48..663edb2c653 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -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') {