Fixed findings

List of Findings

Error: COMPILER_WARNING (CWE-704): [#def1]
samba-4.24.0/auth/credentials/credentials.c: scope_hint: In function ‘cli_credentials_get_principal_and_obtained’
samba-4.24.0/auth/credentials/credentials.c:397:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  397 |                         p = strchr(cred->principal, '@');
#      |                           ^
#  395|   			}
#  396|   
#  397|-> 			p = strchr(cred->principal, '@');
#  398|   			if (p != NULL) {
#  399|   				p += 1;

Error: COMPILER_WARNING (CWE-704): [#def2]
samba-4.24.0/auth/credentials/credentials.c:397:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  395|   			}
#  396|   
#  397|-> 			p = strchr(cred->principal, '@');
#  398|   			if (p != NULL) {
#  399|   				p += 1;

Error: COMPILER_WARNING (CWE-704): [#def3]
samba-4.24.0/auth/credentials/credentials.c: scope_hint: In function ‘cli_credentials_set_principal’
samba-4.24.0/auth/credentials/credentials.c:487:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  487 |                         char *p = strchr(val, '@');
#      |                                   ^~~~~~
#  485|   		cred->principal = NULL;
#  486|   		if (val != NULL) {
#  487|-> 			char *p = strchr(val, '@');
#  488|   			if (p != NULL) {
#  489|   				/* For realm names, only ASCII is allowed */

Error: COMPILER_WARNING (CWE-704): [#def4]
samba-4.24.0/auth/credentials/credentials.c:487:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  485|   		cred->principal = NULL;
#  486|   		if (val != NULL) {
#  487|-> 			char *p = strchr(val, '@');
#  488|   			if (p != NULL) {
#  489|   				/* For realm names, only ASCII is allowed */

Error: COMPILER_WARNING (CWE-704): [#def5]
samba-4.24.0/auth/credentials/credentials.c:500:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  500 |                         p = strchr(cred->principal, '@');
#      |                           ^
#  498|   			}
#  499|   
#  500|-> 			p = strchr(cred->principal, '@');
#  501|   			if (p != NULL) {
#  502|   				p += 1;

Error: COMPILER_WARNING (CWE-704): [#def6]
samba-4.24.0/auth/credentials/credentials.c:500:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  498|   			}
#  499|   
#  500|-> 			p = strchr(cred->principal, '@');
#  501|   			if (p != NULL) {
#  502|   				p += 1;

Error: COMPILER_WARNING (CWE-704): [#def7]
samba-4.24.0/ctdb/protocol/protocol_util.c: scope_hint: In function ‘ip_from_string’
samba-4.24.0/ctdb/protocol/protocol_util.c:257:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  257 |         p = strrchr(str, ':');
#      |           ^
#  255|   	 * IPv4-mapped IPv6 addresses anyway...
#  256|   	 */
#  257|-> 	p = strrchr(str, ':');
#  258|   	if (p == NULL) {
#  259|   		ret = ipv4_from_string(str, &addr->ip);

Error: COMPILER_WARNING (CWE-704): [#def8]
samba-4.24.0/ctdb/protocol/protocol_util.c:257:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  255|   	 * IPv4-mapped IPv6 addresses anyway...
#  256|   	 */
#  257|-> 	p = strrchr(str, ':');
#  258|   	if (p == NULL) {
#  259|   		ret = ipv4_from_string(str, &addr->ip);

Error: COMPILER_WARNING (CWE-704): [#def9]
samba-4.24.0/ctdb/protocol/protocol_util.c:275:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  275 |                         p = strrchr(str, ':');
#      |                           ^
#  273|   			s[len-1] = '\0';
#  274|   			str = s+1;
#  275|-> 			p = strrchr(str, ':');
#  276|   		}
#  277|   

Error: COMPILER_WARNING (CWE-704): [#def10]
samba-4.24.0/ctdb/protocol/protocol_util.c:275:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  273|   			s[len-1] = '\0';
#  274|   			str = s+1;
#  275|-> 			p = strrchr(str, ':');
#  276|   		}
#  277|   

Error: COMPILER_WARNING (CWE-704): [#def11]
samba-4.24.0/lib/addns/dnsquery_srv.c: scope_hint: In function ‘ads_dns_query_srv_send’
samba-4.24.0/lib/addns/dnsquery_srv.c:348:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  348 |                 after_tcp = strstr(state->query, "._tcp.");
#      |                           ^
#  346|   		 * ".<SITENAME>._sites" comes after "._tcp."
#  347|   		 */
#  348|-> 		after_tcp = strstr(state->query, "._tcp.");
#  349|   		if (after_tcp == NULL) {
#  350|   			tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);

Error: COMPILER_WARNING (CWE-704): [#def12]
samba-4.24.0/lib/addns/dnsquery_srv.c:348:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  346|   		 * ".<SITENAME>._sites" comes after "._tcp."
#  347|   		 */
#  348|-> 		after_tcp = strstr(state->query, "._tcp.");
#  349|   		if (after_tcp == NULL) {
#  350|   			tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);

Error: COMPILER_WARNING (CWE-704): [#def13]
samba-4.24.0/lib/cmdline/cmdline.c: scope_hint: In function ‘is_password_option’
samba-4.24.0/lib/cmdline/cmdline.c:241:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  241 |         equals = strchr(p, '=');
#      |                ^
#  239|   	 * the argument to it, which should not be burnt.
#  240|   	 */
#  241|-> 	equals = strchr(p, '=');
#  242|   	if (equals == NULL) {
#  243|   		*ulen = strlen(p);

Error: COMPILER_WARNING (CWE-704): [#def14]
samba-4.24.0/lib/cmdline/cmdline.c:241:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  239|   	 * the argument to it, which should not be burnt.
#  240|   	 */
#  241|-> 	equals = strchr(p, '=');
#  242|   	if (equals == NULL) {
#  243|   		*ulen = strlen(p);

Error: COMPILER_WARNING (CWE-704): [#def15]
samba-4.24.0/lib/cmdline/cmdline.c:245:30: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  245 |                 char *pass = (strstr(p, "pass"));
#      |                              ^
#  243|   		*ulen = strlen(p);
#  244|   	} else {
#  245|-> 		char *pass = (strstr(p, "pass"));
#  246|   		if (pass > equals) {
#  247|   			/* this is --foo=pass, not --pass=foo */

Error: COMPILER_WARNING (CWE-704): [#def16]
samba-4.24.0/lib/cmdline/cmdline.c:245:30: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  243|   		*ulen = strlen(p);
#  244|   	} else {
#  245|-> 		char *pass = (strstr(p, "pass"));
#  246|   		if (pass > equals) {
#  247|   			/* this is --foo=pass, not --pass=foo */

Error: COMPILER_WARNING (CWE-704): [#def17]
samba-4.24.0/lib/ldb/common/ldb_ldif.c: scope_hint: In function ‘ldb_base64_decode’
samba-4.24.0/lib/ldb/common/ldb_ldif.c:117:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  117 |         while (*s && (p=strchr(b64,*s))) {
#      |                        ^
#  115|   	n=i=0;
#  116|   
#  117|-> 	while (*s && (p=strchr(b64,*s))) {
#  118|   		idx = (int)(p - b64);
#  119|   		byte_offset = (i*6)/8;

Error: COMPILER_WARNING (CWE-704): [#def18]
samba-4.24.0/lib/ldb/common/ldb_ldif.c:117:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  115|   	n=i=0;
#  116|   
#  117|-> 	while (*s && (p=strchr(b64,*s))) {
#  118|   		idx = (int)(p - b64);
#  119|   		byte_offset = (i*6)/8;

Error: COMPILER_WARNING (CWE-704): [#def19]
samba-4.24.0/lib/ldb/common/ldb_modules.c: scope_hint: In function ‘ldb_module_connect_backend’
samba-4.24.0/lib/ldb/common/ldb_modules.c:202:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  202 |         colon = strchr(url, ':');
#      |               ^
#  200|   	char *colon = NULL;
#  201|   
#  202|-> 	colon = strchr(url, ':');
#  203|   	if (colon != NULL) {
#  204|   		backend = talloc_strndup(ldb, url, colon-url);

Error: COMPILER_WARNING (CWE-704): [#def20]
samba-4.24.0/lib/ldb/common/ldb_modules.c:202:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  200|   	char *colon = NULL;
#  201|   
#  202|-> 	colon = strchr(url, ':');
#  203|   	if (colon != NULL) {
#  204|   		backend = talloc_strndup(ldb, url, colon-url);

Error: COMPILER_WARNING (CWE-704): [#def21]
samba-4.24.0/lib/printer_driver/printer_driver.c: scope_hint: In function ‘find_manufacturer_name’
samba-4.24.0/lib/printer_driver/printer_driver.c:153:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  153 |         p = strchr(s, ':');
#      |           ^
#  151|   	}
#  152|   
#  153|-> 	p = strchr(s, ':');
#  154|   	if (p == NULL) {
#  155|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def22]
samba-4.24.0/lib/printer_driver/printer_driver.c:153:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  151|   	}
#  152|   
#  153|-> 	p = strchr(s, ':');
#  154|   	if (p == NULL) {
#  155|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def23]
samba-4.24.0/lib/printer_driver/printer_driver.c: scope_hint: In function ‘find_manufacturer_url’
samba-4.24.0/lib/printer_driver/printer_driver.c:208:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  208 |         p = strchr(keys[0], ':');
#      |           ^
#  206|   	}
#  207|   
#  208|-> 	p = strchr(keys[0], ':');
#  209|   	if (p == NULL) {
#  210|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def24]
samba-4.24.0/lib/printer_driver/printer_driver.c:208:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  206|   	}
#  207|   
#  208|-> 	p = strchr(keys[0], ':');
#  209|   	if (p == NULL) {
#  210|   		return NT_STATUS_NO_MEMORY;

Error: COMPILER_WARNING (CWE-704): [#def25]
samba-4.24.0/lib/printer_driver/printer_driver.c: scope_hint: In function ‘add_dependent_driver_file’
samba-4.24.0/lib/printer_driver/printer_driver.c:303:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  303 |         p = strchr(file, ',');
#      |           ^
#  301|   	}
#  302|   
#  303|-> 	p = strchr(file, ',');
#  304|   	if (p != NULL) {
#  305|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def26]
samba-4.24.0/lib/printer_driver/printer_driver.c:303:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  301|   	}
#  302|   
#  303|-> 	p = strchr(file, ',');
#  304|   	if (p != NULL) {
#  305|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def27]
samba-4.24.0/lib/printer_driver/printer_driver.c: scope_hint: In function ‘enum_devices_in_toc’
samba-4.24.0/lib/printer_driver/printer_driver.c:395:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  395 |                                 p = strchr(s, ':');
#      |                                   ^
#  393|   				}
#  394|   
#  395|-> 				p = strchr(s, ':');
#  396|   				if (p == NULL) {
#  397|   					return NT_STATUS_DRIVER_INTERNAL_ERROR;

Error: COMPILER_WARNING (CWE-704): [#def28]
samba-4.24.0/lib/printer_driver/printer_driver.c:395:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  393|   				}
#  394|   
#  395|-> 				p = strchr(s, ':');
#  396|   				if (p == NULL) {
#  397|   					return NT_STATUS_DRIVER_INTERNAL_ERROR;

Error: COMPILER_WARNING (CWE-704): [#def29]
samba-4.24.0/lib/printer_driver/printer_driver.c: scope_hint: In function ‘process_driver_section_copyfiles’
samba-4.24.0/lib/printer_driver/printer_driver.c:509:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  509 |                                 p = strchr(keys[i], ':');
#      |                                   ^
#  507|   		if (NT_STATUS_IS_OK(status)) {
#  508|   			for (i = 0; i < num_keys; i++) {
#  509|-> 				p = strchr(keys[i], ':');
#  510|   				if (p == NULL) {
#  511|   					return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def30]
samba-4.24.0/lib/printer_driver/printer_driver.c:509:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  507|   		if (NT_STATUS_IS_OK(status)) {
#  508|   			for (i = 0; i < num_keys; i++) {
#  509|-> 				p = strchr(keys[i], ':');
#  510|   				if (p == NULL) {
#  511|   					return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def31]
samba-4.24.0/lib/printer_driver/printer_driver.c: scope_hint: In function ‘process_driver_section_printprocessor’
samba-4.24.0/lib/printer_driver/printer_driver.c:587:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  587 |                 p = strchr(s, ',');
#      |                   ^
#  585|   		s = get_string_unquote(s);
#  586|   
#  587|-> 		p = strchr(s, ',');
#  588|   		if (p == NULL) {
#  589|   			return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def32]
samba-4.24.0/lib/printer_driver/printer_driver.c:587:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  585|   		s = get_string_unquote(s);
#  586|   
#  587|-> 		p = strchr(s, ',');
#  588|   		if (p == NULL) {
#  589|   			return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def33]
samba-4.24.0/lib/printer_driver/printer_driver.c: scope_hint: In function ‘process_driver_driverver’
samba-4.24.0/lib/printer_driver/printer_driver.c:886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  886 |         p = strchr(str, ',');
#      |           ^
#  884|   	}
#  885|   
#  886|-> 	p = strchr(str, ',');
#  887|   	if (p) {
#  888|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def34]
samba-4.24.0/lib/printer_driver/printer_driver.c:886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  884|   	}
#  885|   
#  886|-> 	p = strchr(str, ',');
#  887|   	if (p) {
#  888|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def35]
samba-4.24.0/lib/util/base64.c: scope_hint: In function ‘base64_decode_data_blob_talloc’
samba-4.24.0/lib/util/base64.c:51:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   51 |         while (*s && (p=strchr(b64,*s))) {
#      |                        ^
#   49|   	n=i=0;
#   50|   
#   51|-> 	while (*s && (p=strchr(b64,*s))) {
#   52|   		idx = (int)(p - b64);
#   53|   		byte_offset = (i*6)/8;

Error: COMPILER_WARNING (CWE-704): [#def36]
samba-4.24.0/lib/util/base64.c:51:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   49|   	n=i=0;
#   50|   
#   51|-> 	while (*s && (p=strchr(b64,*s))) {
#   52|   		idx = (int)(p - b64);
#   53|   		byte_offset = (i*6)/8;

Error: COMPILER_WARNING (CWE-704): [#def37]
samba-4.24.0/lib/util/charset/util_str.c: scope_hint: In function ‘strchr_m’
samba-4.24.0/lib/util/charset/util_str.c:370:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  370 |                 return strchr(src, c);
#      |                        ^~~~~~
#  368|   	   non-initial position in multi-byte charsets */
#  369|   	if ((c & 0xC0) == 0) {
#  370|-> 		return strchr(src, c);
#  371|   	}
#  372|   

Error: COMPILER_WARNING (CWE-704): [#def38]
samba-4.24.0/lib/util/charset/util_str.c:370:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  368|   	   non-initial position in multi-byte charsets */
#  369|   	if ((c & 0xC0) == 0) {
#  370|-> 		return strchr(src, c);
#  371|   	}
#  372|   

Error: COMPILER_WARNING (CWE-704): [#def39]
samba-4.24.0/lib/util/charset/util_str.c: scope_hint: In function ‘strrchr_m’
samba-4.24.0/lib/util/charset/util_str.c:420:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  420 |                 return strrchr(s, c);
#      |                        ^~~~~~~
#  418|   	   non-initial position in multi-byte charsets */
#  419|   	if ((c & 0xC0) == 0) {
#  420|-> 		return strrchr(s, c);
#  421|   	}
#  422|   

Error: COMPILER_WARNING (CWE-704): [#def40]
samba-4.24.0/lib/util/charset/util_str.c:420:24: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type
#  418|   	   non-initial position in multi-byte charsets */
#  419|   	if ((c & 0xC0) == 0) {
#  420|-> 		return strrchr(s, c);
#  421|   	}
#  422|   

Error: COMPILER_WARNING (CWE-704): [#def41]
samba-4.24.0/lib/util/smb_strtox.c: scope_hint: In function ‘smb_strtoul’
samba-4.24.0/lib/util/smb_strtox.c:83:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   83 |                 needle = strchr(nptr, '-');
#      |                        ^
#   81|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#   82|   		/* did we convert a negative "number" ? */
#   83|-> 		needle = strchr(nptr, '-');
#   84|   		if (needle != NULL && needle < tmp_endptr) {
#   85|   			*err = EINVAL;

Error: COMPILER_WARNING (CWE-704): [#def42]
samba-4.24.0/lib/util/smb_strtox.c:83:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   81|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#   82|   		/* did we convert a negative "number" ? */
#   83|-> 		needle = strchr(nptr, '-');
#   84|   		if (needle != NULL && needle < tmp_endptr) {
#   85|   			*err = EINVAL;

Error: COMPILER_WARNING (CWE-704): [#def43]
samba-4.24.0/lib/util/smb_strtox.c: scope_hint: In function ‘smb_strtoull’
samba-4.24.0/lib/util/smb_strtox.c:159:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  159 |                 needle = strchr(nptr, '-');
#      |                        ^
#  157|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#  158|   		/* did we convert a negative "number" ? */
#  159|-> 		needle = strchr(nptr, '-');
#  160|   		if (needle != NULL && needle < tmp_endptr) {
#  161|   			*err = EINVAL;

Error: COMPILER_WARNING (CWE-704): [#def44]
samba-4.24.0/lib/util/smb_strtox.c:159:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  157|   	if ((flags & SMB_STR_ALLOW_NEGATIVE ) == 0) {
#  158|   		/* did we convert a negative "number" ? */
#  159|-> 		needle = strchr(nptr, '-');
#  160|   		if (needle != NULL && needle < tmp_endptr) {
#  161|   			*err = EINVAL;

Error: COMPILER_WARNING (CWE-704): [#def45]
samba-4.24.0/libcli/auth/netlogon_creds_cli.c: scope_hint: In function ‘netlogon_creds_cli_context_common’
samba-4.24.0/libcli/auth/netlogon_creds_cli.c:172:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  172 |         p = strchr(server_computer, '.');
#      |           ^
#  170|   	 */
#  171|   
#  172|-> 	p = strchr(server_computer, '.');
#  173|   	if (p != NULL) {
#  174|   		server_netbios_name_len = p-server_computer;

Error: COMPILER_WARNING (CWE-704): [#def46]
samba-4.24.0/libcli/auth/netlogon_creds_cli.c:172:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  170|   	 */
#  171|   
#  172|-> 	p = strchr(server_computer, '.');
#  173|   	if (p != NULL) {
#  174|   		server_netbios_name_len = p-server_computer;

Error: COMPILER_WARNING: [#def47]
samba-4.24.0/libcli/auth/smbencrypt.c:1387:17: warning[-Wstringop-overflow=]: ‘memset_explicit’ writing 512 bytes into a region of size 8 overflows the destination
# 1385|   				 string_flags);
# 1386|   	if (new_pw_len < 0) {
# 1387|-> 		BURN_DATA_SIZE(buf, PASSWORD_BUFFER_LEN);
# 1388|   		return -1;
# 1389|   	}

Error: COMPILER_WARNING (CWE-704): [#def48]
samba-4.24.0/libcli/nbt/tools/nmblookup.c: scope_hint: In function ‘process_one’
samba-4.24.0/libcli/nbt/tools/nmblookup.c:212:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  212 |         p = strchr(name, '#');
#      |           ^
#  210|   	}
#  211|   
#  212|-> 	p = strchr(name, '#');
#  213|   	if (p) {
#  214|   		node_name = talloc_strndup(tmp_ctx, name, PTR_DIFF(p,name));

Error: COMPILER_WARNING (CWE-704): [#def49]
samba-4.24.0/libcli/nbt/tools/nmblookup.c:212:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  210|   	}
#  211|   
#  212|-> 	p = strchr(name, '#');
#  213|   	if (p) {
#  214|   		node_name = talloc_strndup(tmp_ctx, name, PTR_DIFF(p,name));

Error: COMPILER_WARNING (CWE-704): [#def50]
samba-4.24.0/librpc/rpc/binding.c: scope_hint: In function ‘dcerpc_parse_binding’
samba-4.24.0/librpc/rpc/binding.c:398:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  398 |                 p = strchr(name, '=');
#      |                   ^
#  396|   		}
#  397|   
#  398|-> 		p = strchr(name, '=');
#  399|   		if (p != NULL) {
#  400|   			*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def51]
samba-4.24.0/librpc/rpc/binding.c:398:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  396|   		}
#  397|   
#  398|-> 		p = strchr(name, '=');
#  399|   		if (p != NULL) {
#  400|   			*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def52]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxLookupUserSids’
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:720:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  720 |                 char *n = strchr(s, '\n');
#      |                           ^~~~~~
#  718|   	s = (const char *)response.extra_data.data;
#  719|   	for (i = 0; i < response.data.num_entries; i++) {
#  720|-> 		char *n = strchr(s, '\n');
#  721|   		if (n) {
#  722|   			*n = '\0';

Error: COMPILER_WARNING (CWE-704): [#def53]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:720:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  718|   	s = (const char *)response.extra_data.data;
#  719|   	for (i = 0; i < response.data.num_entries; i++) {
#  720|-> 		char *n = strchr(s, '\n');
#  721|   		if (n) {
#  722|   			*n = '\0';

Error: COMPILER_WARNING (CWE-704): [#def54]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxGetSidAliases’
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:851:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  851 |                 char *n = strchr(s, '\n');
#      |                           ^~~~~~
#  849|   	s = (const char *)response.extra_data.data;
#  850|   	for (i = 0; i < response.data.num_entries; i++) {
#  851|-> 		char *n = strchr(s, '\n');
#  852|   		if (n) {
#  853|   			*n = '\0';

Error: COMPILER_WARNING (CWE-704): [#def55]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:851:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  849|   	s = (const char *)response.extra_data.data;
#  850|   	for (i = 0; i < response.data.num_entries; i++) {
#  851|-> 		char *n = strchr(s, '\n');
#  852|   		if (n) {
#  853|   			*n = '\0';

Error: COMPILER_WARNING (CWE-704): [#def56]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxListUsers’
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:933:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  933 |                 k = strchr(next, ',');
#      |                   ^
#  931|   
#  932|   		current = next;
#  933|-> 		k = strchr(next, ',');
#  934|   
#  935|   		if (k) {

Error: COMPILER_WARNING (CWE-704): [#def57]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:933:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  931|   
#  932|   		current = next;
#  933|-> 		k = strchr(next, ',');
#  934|   
#  935|   		if (k) {

Error: COMPILER_WARNING (CWE-704): [#def58]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c: scope_hint: In function ‘wbcCtxListGroups’
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:1017:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1017 |                 k = strchr(next, ',');
#      |                   ^
# 1015|   
# 1016|   		current = next;
# 1017|-> 		k = strchr(next, ',');
# 1018|   
# 1019|   		if (k) {

Error: COMPILER_WARNING (CWE-704): [#def59]
samba-4.24.0/nsswitch/libwbclient/wbc_sid.c:1017:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1015|   
# 1016|   		current = next;
# 1017|-> 		k = strchr(next, ',');
# 1018|   
# 1019|   		if (k) {

Error: COMPILER_WARNING (CWE-704): [#def60]
samba-4.24.0/nsswitch/pam_winbind.c: scope_hint: In function ‘get_conf_item_string’
samba-4.24.0/nsswitch/pam_winbind.c:2345:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2345 |                         if ((p = strchr(ctx->argv[i], '=')) == NULL) {
#      |                                ^
# 2343|   			char *p;
# 2344|   
# 2345|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2346|   				_pam_log(ctx, LOG_INFO,
# 2347|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: COMPILER_WARNING (CWE-704): [#def61]
samba-4.24.0/nsswitch/pam_winbind.c:2345:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2343|   			char *p;
# 2344|   
# 2345|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2346|   				_pam_log(ctx, LOG_INFO,
# 2347|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: COMPILER_WARNING (CWE-704): [#def62]
samba-4.24.0/nsswitch/pam_winbind.c: scope_hint: In function ‘get_config_item_int’
samba-4.24.0/nsswitch/pam_winbind.c:2391:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2391 |                         if ((p = strchr(ctx->argv[i], '=')) == NULL) {
#      |                                ^
# 2389|   			char *p;
# 2390|   
# 2391|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2392|   				_pam_log(ctx, LOG_INFO,
# 2393|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: COMPILER_WARNING (CWE-704): [#def63]
samba-4.24.0/nsswitch/pam_winbind.c:2391:32: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2389|   			char *p;
# 2390|   
# 2391|-> 			if ((p = strchr(ctx->argv[i], '=')) == NULL) {
# 2392|   				_pam_log(ctx, LOG_INFO,
# 2393|   					 "no \"=\" delimiter for \"%s\" found\n",

Error: COMPILER_WARNING (CWE-704): [#def64]
samba-4.24.0/nsswitch/wbinfo.c: scope_hint: In function ‘parse_wbinfo_domain_user’
samba-4.24.0/nsswitch/wbinfo.c:119:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  119 |         char *p = strchr(domuser,winbind_separator());
#      |                   ^~~~~~
#  117|   {
#  118|   
#  119|-> 	char *p = strchr(domuser,winbind_separator());
#  120|   
#  121|   	if (!p) {

Error: COMPILER_WARNING (CWE-704): [#def65]
samba-4.24.0/nsswitch/wbinfo.c:119:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  117|   {
#  118|   
#  119|-> 	char *p = strchr(domuser,winbind_separator());
#  120|   
#  121|   	if (!p) {

Error: COMPILER_WARNING (CWE-704): [#def66]
samba-4.24.0/nsswitch/wbinfo.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  123 |                 p = strchr(domuser, '@');
#      |                   ^
#  121|   	if (!p) {
#  122|   		/* Maybe it was a UPN? */
#  123|-> 		p = strchr(domuser, '@');
#  124|   		if (p != NULL) {
#  125|   			fstrcpy(domain, "");

Error: COMPILER_WARNING (CWE-704): [#def67]
samba-4.24.0/nsswitch/wbinfo.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  121|   	if (!p) {
#  122|   		/* Maybe it was a UPN? */
#  123|-> 		p = strchr(domuser, '@');
#  124|   		if (p != NULL) {
#  125|   			fstrcpy(domain, "");

Error: COMPILER_WARNING (CWE-704): [#def68]
samba-4.24.0/source3/lib/wins_srv.c: scope_hint: In function ‘parse_ip’
samba-4.24.0/source3/lib/wins_srv.c:185:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  185 |         char *s = strchr(str, ':');
#      |                   ^~~~~~
#  183|   static void parse_ip(struct tagged_ip *ip, const char *str)
#  184|   {
#  185|-> 	char *s = strchr(str, ':');
#  186|   	if (!s) {
#  187|   		fstrcpy(ip->tag, "*");

Error: COMPILER_WARNING (CWE-704): [#def69]
samba-4.24.0/source3/lib/wins_srv.c:185:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  183|   static void parse_ip(struct tagged_ip *ip, const char *str)
#  184|   {
#  185|-> 	char *s = strchr(str, ':');
#  186|   	if (!s) {
#  187|   		fstrcpy(ip->tag, "*");

Error: COMPILER_WARNING (CWE-704): [#def70]
samba-4.24.0/source3/libads/ldap.c: scope_hint: In function ‘ads_parent_dn’
samba-4.24.0/source3/libads/ldap.c:1862:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1862 |         p = strchr(dn, ',');
#      |           ^
# 1860|   	}
# 1861|   
# 1862|-> 	p = strchr(dn, ',');
# 1863|   
# 1864|   	if (p == NULL) {

Error: COMPILER_WARNING (CWE-704): [#def71]
samba-4.24.0/source3/libads/ldap.c:1862:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1860|   	}
# 1861|   
# 1862|-> 	p = strchr(dn, ',');
# 1863|   
# 1864|   	if (p == NULL) {

Error: COMPILER_WARNING (CWE-704): [#def72]
samba-4.24.0/source3/libsmb/cliconnect.c: scope_hint: In function ‘cli_connect_nb_send’
samba-4.24.0/source3/libsmb/cliconnect.c:2535:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 2535 |                 char *p = strchr(host, '#');
#      |                           ^~~~~~
# 2533|   
# 2534|   	if (host != NULL) {
# 2535|-> 		char *p = strchr(host, '#');
# 2536|   
# 2537|   		if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def73]
samba-4.24.0/source3/libsmb/cliconnect.c:2535:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
# 2533|   
# 2534|   	if (host != NULL) {
# 2535|-> 		char *p = strchr(host, '#');
# 2536|   
# 2537|   		if (p != NULL) {

Error: COMPILER_WARNING (CWE-704): [#def74]
samba-4.24.0/source3/libsmb/libsmb_path.c: scope_hint: In function ‘SMBC_parse_path’
samba-4.24.0/source3/libsmb/libsmb_path.c:270:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  270 |         if ((q = strrchr(p, '?')) != NULL ) {
#      |                ^
#  268|   
#  269|           /* See if any options were specified */
#  270|->         if ((q = strrchr(p, '?')) != NULL ) {
#  271|                   /* There are options.  Null terminate here and point to them */
#  272|                   *q++ = '\0';

Error: COMPILER_WARNING (CWE-704): [#def75]
samba-4.24.0/source3/libsmb/libsmb_path.c:270:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  268|   
#  269|           /* See if any options were specified */
#  270|->         if ((q = strrchr(p, '?')) != NULL ) {
#  271|                   /* There are options.  Null terminate here and point to them */
#  272|                   *q++ = '\0';

Error: COMPILER_WARNING (CWE-704): [#def76]
samba-4.24.0/source3/modules/vfs_fruit.c: scope_hint: In function ‘fruit_tmsize_do_dirent’
samba-4.24.0/source3/modules/vfs_fruit.c:5341:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5341 |         p = strstr(name, "sparsebundle");
#      |           ^
# 5339|   	off_t tm_size;
# 5340|   
# 5341|-> 	p = strstr(name, "sparsebundle");
# 5342|   	if (p == NULL) {
# 5343|   		return true;

Error: COMPILER_WARNING (CWE-704): [#def77]
samba-4.24.0/source3/modules/vfs_fruit.c:5341:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5339|   	off_t tm_size;
# 5340|   
# 5341|-> 	p = strstr(name, "sparsebundle");
# 5342|   	if (p == NULL) {
# 5343|   		return true;

Error: COMPILER_WARNING (CWE-704): [#def78]
samba-4.24.0/source3/modules/vfs_media_harmony.c: scope_hint: In function ‘alloc_get_client_path’
samba-4.24.0/source3/modules/vfs_media_harmony.c:410:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  410 |                 (pathPtr = strstr(path, CREATING_DIRNAME)) != NULL
#      |                          ^
#  408|   	DEBUG(MH_INFO_DEBUG, ("newPath #1 %s\n", *newPath));
#  409|   	if (
#  410|-> 		(pathPtr = strstr(path, CREATING_DIRNAME)) != NULL
#  411|   			&&
#  412|   		(

Error: COMPILER_WARNING (CWE-704): [#def79]
samba-4.24.0/source3/modules/vfs_media_harmony.c:410:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  408|   	DEBUG(MH_INFO_DEBUG, ("newPath #1 %s\n", *newPath));
#  409|   	if (
#  410|-> 		(pathPtr = strstr(path, CREATING_DIRNAME)) != NULL
#  411|   			&&
#  412|   		(

Error: COMPILER_WARNING (CWE-704): [#def80]
samba-4.24.0/source3/modules/vfs_shadow_copy2.c: scope_hint: In function ‘shadow_copy2_connect’
samba-4.24.0/source3/modules/vfs_shadow_copy2.c:3018:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3018 |                         p = strstr(basedir, config->mount_point);
#      |                           ^
# 3016|   		} else {
# 3017|   			char *p;
# 3018|-> 			p = strstr(basedir, config->mount_point);
# 3019|   			if (p != basedir) {
# 3020|   				DEBUG(1, ("Warning: basedir (%s) is not a "

Error: COMPILER_WARNING (CWE-704): [#def81]
samba-4.24.0/source3/modules/vfs_shadow_copy2.c:3018:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3016|   		} else {
# 3017|   			char *p;
# 3018|-> 			p = strstr(basedir, config->mount_point);
# 3019|   			if (p != basedir) {
# 3020|   				DEBUG(1, ("Warning: basedir (%s) is not a "

Error: COMPILER_WARNING (CWE-704): [#def82]
samba-4.24.0/source3/modules/vfs_virusfilter.c: scope_hint: In function ‘virusfilter_vfs_connect’
samba-4.24.0/source3/modules/vfs_virusfilter.c:370:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  370 |                 sret = strstr(config->quarantine_prefix, "/");
#      |                      ^
#  368|   	 */
#  369|   	if (config->quarantine_prefix != NULL) {
#  370|-> 		sret = strstr(config->quarantine_prefix, "/");
#  371|   		if (sret != NULL) {
#  372|   			DBG_ERR("quarantine prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def83]
samba-4.24.0/source3/modules/vfs_virusfilter.c:370:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  368|   	 */
#  369|   	if (config->quarantine_prefix != NULL) {
#  370|-> 		sret = strstr(config->quarantine_prefix, "/");
#  371|   		if (sret != NULL) {
#  372|   			DBG_ERR("quarantine prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def84]
samba-4.24.0/source3/modules/vfs_virusfilter.c:381:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  381 |                 sret = strstr(config->quarantine_suffix, "/");
#      |                      ^
#  379|   	}
#  380|   	if (config->quarantine_suffix != NULL) {
#  381|-> 		sret = strstr(config->quarantine_suffix, "/");
#  382|   		if (sret != NULL) {
#  383|   			DBG_ERR("quarantine suffix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def85]
samba-4.24.0/source3/modules/vfs_virusfilter.c:381:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  379|   	}
#  380|   	if (config->quarantine_suffix != NULL) {
#  381|-> 		sret = strstr(config->quarantine_suffix, "/");
#  382|   		if (sret != NULL) {
#  383|   			DBG_ERR("quarantine suffix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def86]
samba-4.24.0/source3/modules/vfs_virusfilter.c:425:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  425 |                 sret = strstr(config->rename_prefix, "/");
#      |                      ^
#  423|   	 */
#  424|   	if (config->rename_prefix != NULL) {
#  425|-> 		sret = strstr(config->rename_prefix, "/");
#  426|   		if (sret != NULL) {
#  427|   			DBG_ERR("rename prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def87]
samba-4.24.0/source3/modules/vfs_virusfilter.c:425:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  423|   	 */
#  424|   	if (config->rename_prefix != NULL) {
#  425|-> 		sret = strstr(config->rename_prefix, "/");
#  426|   		if (sret != NULL) {
#  427|   			DBG_ERR("rename prefix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def88]
samba-4.24.0/source3/modules/vfs_virusfilter.c:436:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  436 |                 sret = strstr(config->rename_suffix, "/");
#      |                      ^
#  434|   	}
#  435|   	if (config->rename_suffix != NULL) {
#  436|-> 		sret = strstr(config->rename_suffix, "/");
#  437|   		if (sret != NULL) {
#  438|   			DBG_ERR("rename suffix must not contain directory "

Error: COMPILER_WARNING (CWE-704): [#def89]
samba-4.24.0/source3/modules/vfs_virusfilter.c:436:22: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  434|   	}
#  435|   	if (config->rename_suffix != NULL) {
#  436|-> 		sret = strstr(config->rename_suffix, "/");
#  437|   		if (sret != NULL) {
#  438|   			DBG_ERR("rename suffix must not contain directory "

Error: COMPILER_WARNING: [#def90]
samba-4.24.0/source3/nmbd/nmbd_become_lmb.c: scope_hint: In function ‘become_local_master_browser’
samba-4.24.0/source3/nmbd/nmbd_become_lmb.c:549:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  549 |         strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.24.0/source3/nmbd/nmbd_become_lmb.c:24: included_from: Included from here.
samba-4.24.0/source3/nmbd/nmbd.h:212:14: note: destination object ‘data’ of size 16
#  212 |         char data[16]; /* 16 is to ensure alignment/padding on all systems */
#      |              ^~~~
/usr/include/features.h:540: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
samba-4.24.0/lib/replace/replace.h:48: included_from: Included from here.
samba-4.24.0/source3/include/includes.h:23: included_from: Included from here.
samba-4.24.0/source3/nmbd/nmbd_become_lmb.c:23: included_from: Included from here.
/usr/include/bits/string_fortified.h:173:1: note: in a call to function ‘strlcpy’ declared with attribute ‘access (write_only, 1, 3)’
#  173 | __NTH (strlcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
#      | ^~~~~
#  547|   	userdata->free_fn = NULL;
#  548|   	userdata->userdata_len = strlen(work->work_group)+1;
#  549|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  550|   
#  551|   	/* Register the special browser group name. */

Error: COMPILER_WARNING: [#def91]
samba-4.24.0/source3/nmbd/nmbd_become_lmb.c:549:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  547|   	userdata->free_fn = NULL;
#  548|   	userdata->userdata_len = strlen(work->work_group)+1;
#  549|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  550|   
#  551|   	/* Register the special browser group name. */

Error: COMPILER_WARNING: [#def92]
samba-4.24.0/source3/nmbd/nmbd_browsesync.c: scope_hint: In function ‘find_domain_master_name_query_success’
samba-4.24.0/source3/nmbd/nmbd_browsesync.c:337:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  337 |         strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
samba-4.24.0/source3/nmbd/nmbd_browsesync.c:24: included_from: Included from here.
samba-4.24.0/source3/nmbd/nmbd.h:212:14: note: destination object ‘data’ of size 16
#  212 |         char data[16]; /* 16 is to ensure alignment/padding on all systems */
#      |              ^~~~
/usr/include/features.h:540: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
samba-4.24.0/lib/replace/replace.h:48: included_from: Included from here.
samba-4.24.0/source3/include/includes.h:23: included_from: Included from here.
samba-4.24.0/source3/nmbd/nmbd_browsesync.c:23: included_from: Included from here.
/usr/include/bits/string_fortified.h:173:1: note: in a call to function ‘strlcpy’ declared with attribute ‘access (write_only, 1, 3)’
#  173 | __NTH (strlcpy (__fortify_clang_overload_arg (char *, __restrict, __dest),
#      | ^~~~~
#  335|   	userdata->free_fn = NULL;
#  336|   	userdata->userdata_len = strlen(work->work_group)+1;
#  337|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  338|   
#  339|   	node_status( subrec, &nmbname, answer_ip, 

Error: COMPILER_WARNING: [#def93]
samba-4.24.0/source3/nmbd/nmbd_browsesync.c:337:9: warning[-Wstringop-overflow=]: ‘strlcpy’ writing 257 bytes into a region of size 16 overflows the destination
#  335|   	userdata->free_fn = NULL;
#  336|   	userdata->userdata_len = strlen(work->work_group)+1;
#  337|-> 	strlcpy(userdata->data, work->work_group, size - sizeof(*userdata));
#  338|   
#  339|   	node_status( subrec, &nmbname, answer_ip, 

Error: COMPILER_WARNING (CWE-704): [#def94]
samba-4.24.0/source3/param/util.c: scope_hint: In function ‘get_int_param’
samba-4.24.0/source3/param/util.c:30:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   30 |         p = strchr( param, '=' );
#      |           ^
#   28|   	char *p;
#   29|   
#   30|-> 	p = strchr( param, '=' );
#   31|   	if ( !p )
#   32|   		return 0;

Error: COMPILER_WARNING (CWE-704): [#def95]
samba-4.24.0/source3/param/util.c:30:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   28|   	char *p;
#   29|   
#   30|-> 	p = strchr( param, '=' );
#   31|   	if ( !p )
#   32|   		return 0;

Error: COMPILER_WARNING (CWE-704): [#def96]
samba-4.24.0/source3/param/util.c: scope_hint: In function ‘get_string_param’
samba-4.24.0/source3/param/util.c:45:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   45 |         p = strchr( param, '=' );
#      |           ^
#   43|   	char *p;
#   44|   
#   45|-> 	p = strchr( param, '=' );
#   46|   	if ( !p )
#   47|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def97]
samba-4.24.0/source3/param/util.c:45:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   43|   	char *p;
#   44|   
#   45|-> 	p = strchr( param, '=' );
#   46|   	if ( !p )
#   47|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def98]
samba-4.24.0/source3/printing/nt_printing.c: scope_hint: In function ‘clean_up_driver_struct_level’
samba-4.24.0/source3/printing/nt_printing.c:1168:30: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1168 |         if (_element && ((_p = strrchr((_element), '\\')) != NULL)) { \
#      |                              ^
samba-4.24.0/source3/printing/nt_printing.c:1242:9: note: in expansion of macro ‘strip_driver_path’
# 1242 |         strip_driver_path(mem_ctx, *driver_path);
#      |         ^~~~~~~~~~~~~~~~~
# 1166|   
# 1167|   #define strip_driver_path(_mem_ctx, _element) do { \
# 1168|-> 	if (_element && ((_p = strrchr((_element), '\\')) != NULL)) { \
# 1169|   		(_element) = talloc_asprintf((_mem_ctx), "%s", _p+1); \
# 1170|   		W_ERROR_HAVE_NO_MEMORY((_element)); \

Error: COMPILER_WARNING (CWE-704): [#def99]
samba-4.24.0/source3/printing/nt_printing.c:1242:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1240|   	/* using an intermediate string to not have overlapping memcpy()'s */
# 1241|   
# 1242|-> 	strip_driver_path(mem_ctx, *driver_path);
# 1243|   	strip_driver_path(mem_ctx, *data_file);
# 1244|   	if (*config_file) {

Error: COMPILER_WARNING (CWE-704): [#def100]
samba-4.24.0/source3/printing/nt_printing.c:1243:9: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1241|   
# 1242|   	strip_driver_path(mem_ctx, *driver_path);
# 1243|-> 	strip_driver_path(mem_ctx, *data_file);
# 1244|   	if (*config_file) {
# 1245|   		strip_driver_path(mem_ctx, *config_file);

Error: COMPILER_WARNING (CWE-704): [#def101]
samba-4.24.0/source3/printing/nt_printing.c:1245:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1243|   	strip_driver_path(mem_ctx, *data_file);
# 1244|   	if (*config_file) {
# 1245|-> 		strip_driver_path(mem_ctx, *config_file);
# 1246|   	}
# 1247|   	if (help_file) {

Error: COMPILER_WARNING (CWE-704): [#def102]
samba-4.24.0/source3/printing/nt_printing.c:1248:17: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1246|   	}
# 1247|   	if (help_file) {
# 1248|-> 		strip_driver_path(mem_ctx, *help_file);
# 1249|   	}
# 1250|   

Error: COMPILER_WARNING (CWE-704): [#def103]
samba-4.24.0/source3/printing/nt_printing.c:1253:25: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1251|   	if (dependent_files && dependent_files->string) {
# 1252|   		for (i=0; dependent_files->string[i]; i++) {
# 1253|-> 			strip_driver_path(mem_ctx, dependent_files->string[i]);
# 1254|   		}
# 1255|   	}

Error: COMPILER_WARNING (CWE-704): [#def104]
samba-4.24.0/source3/printing/nt_printing_migrate.c: scope_hint: In function ‘printing_tdb_migrate_printer’
samba-4.24.0/source3/printing/nt_printing_migrate.c:317:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  317 |                 valuename = strchr(keyname, '\\');
#      |                           ^
#  315|   
#  316|   		keyname = r.printer_data[j].name;
#  317|-> 		valuename = strchr(keyname, '\\');
#  318|   		if (valuename == NULL) {
#  319|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def105]
samba-4.24.0/source3/printing/nt_printing_migrate.c:317:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  315|   
#  316|   		keyname = r.printer_data[j].name;
#  317|-> 		valuename = strchr(keyname, '\\');
#  318|   		if (valuename == NULL) {
#  319|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def106]
samba-4.24.0/source3/printing/print_iprint.c: scope_hint: In function ‘iprint_get_server_version’
samba-4.24.0/source3/printing/print_iprint.c:170:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  170 |                 if ((ver = strstr(ippGetString(attr, 0, NULL),
#      |                          ^
#  168|   	if (((attr = ippFindAttribute(response, "server-version",
#  169|   	                              IPP_TAG_STRING)) != NULL)) {
#  170|-> 		if ((ver = strstr(ippGetString(attr, 0, NULL),
#  171|                                     NOVELL_SERVER_VERSION_STRING)) != NULL) {
#  172|   			ver += strlen(NOVELL_SERVER_VERSION_STRING);

Error: COMPILER_WARNING (CWE-704): [#def107]
samba-4.24.0/source3/printing/print_iprint.c:170:26: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  168|   	if (((attr = ippFindAttribute(response, "server-version",
#  169|   	                              IPP_TAG_STRING)) != NULL)) {
#  170|-> 		if ((ver = strstr(ippGetString(attr, 0, NULL),
#  171|                                     NOVELL_SERVER_VERSION_STRING)) != NULL) {
#  172|   			ver += strlen(NOVELL_SERVER_VERSION_STRING);

Error: COMPILER_WARNING (CWE-704): [#def108]
samba-4.24.0/source3/printing/print_iprint.c:186:25: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  186 |                 if ((os = strstr(ippGetString(attr, 0, NULL),
#      |                         ^
#  184|   		}
#  185|   
#  186|-> 		if ((os = strstr(ippGetString(attr, 0, NULL),
#  187|                                     NOVELL_SERVER_SYSNAME)) != NULL) {
#  188|   			os += strlen(NOVELL_SERVER_SYSNAME);

Error: COMPILER_WARNING (CWE-704): [#def109]
samba-4.24.0/source3/printing/print_iprint.c:186:25: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  184|   		}
#  185|   
#  186|-> 		if ((os = strstr(ippGetString(attr, 0, NULL),
#  187|                                     NOVELL_SERVER_SYSNAME)) != NULL) {
#  188|   			os += strlen(NOVELL_SERVER_SYSNAME);

Error: COMPILER_WARNING (CWE-704): [#def110]
samba-4.24.0/source3/rpc_server/rpc_host.c: scope_hint: In function ‘rpc_exe_parse_iface_line’
samba-4.24.0/source3/rpc_server/rpc_host.c:317:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  317 |         name = strchr(line, ' ');
#      |              ^
#  315|   	}
#  316|   
#  317|-> 	name = strchr(line, ' ');
#  318|   	if (name == NULL) {
#  319|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def111]
samba-4.24.0/source3/rpc_server/rpc_host.c:317:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  315|   	}
#  316|   
#  317|-> 	name = strchr(line, ' ');
#  318|   	if (name == NULL) {
#  319|   		return NULL;

Error: COMPILER_WARNING (CWE-704): [#def112]
samba-4.24.0/source3/smbd/filename.c: scope_hint: In function ‘get_original_lcomp’
samba-4.24.0/source3/smbd/filename.c:423:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  423 |         last_slash = strrchr(filename_in, '/');
#      |                    ^
#  421|   	NTSTATUS status;
#  422|   
#  423|-> 	last_slash = strrchr(filename_in, '/');
#  424|   	if (last_slash != NULL) {
#  425|   		orig_lcomp = talloc_strdup(ctx, last_slash+1);

Error: COMPILER_WARNING (CWE-704): [#def113]
samba-4.24.0/source3/smbd/filename.c:423:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  421|   	NTSTATUS status;
#  422|   
#  423|-> 	last_slash = strrchr(filename_in, '/');
#  424|   	if (last_slash != NULL) {
#  425|   		orig_lcomp = talloc_strdup(ctx, last_slash+1);

Error: COMPILER_WARNING (CWE-704): [#def114]
samba-4.24.0/source3/smbd/mangle_hash.c: scope_hint: In function ‘cache_mangled_name’
samba-4.24.0/source3/smbd/mangle_hash.c:818:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  818 |         if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
#      |                       ^
#  816|   	 */
#  817|   	s1 = strrchr( mangled_name_key, '.' );
#  818|-> 	if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
#  819|   		size_t i = 1;
#  820|   		while( s1[i] && (tolower_m( s1[i] ) == s2[i]) )

Error: COMPILER_WARNING (CWE-704): [#def115]
samba-4.24.0/source3/smbd/mangle_hash.c:818:23: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  816|   	 */
#  817|   	s1 = strrchr( mangled_name_key, '.' );
#  818|-> 	if( s1 && (s2 = strrchr( raw_name, '.' )) ) {
#  819|   		size_t i = 1;
#  820|   		while( s1[i] && (tolower_m( s1[i] ) == s2[i]) )

Error: COMPILER_WARNING (CWE-704): [#def116]
samba-4.24.0/source3/smbd/mangle_hash2.c: scope_hint: In function ‘is_8_3’
samba-4.24.0/source3/smbd/mangle_hash2.c:461:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  461 |         dot_p = strchr(name, '.');
#      |               ^
#  459|   	/* find the '.'. Note that once again we use the non-multibyte
#  460|              function */
#  461|-> 	dot_p = strchr(name, '.');
#  462|   
#  463|   	if (!dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def117]
samba-4.24.0/source3/smbd/mangle_hash2.c:461:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  459|   	/* find the '.'. Note that once again we use the non-multibyte
#  460|              function */
#  461|-> 	dot_p = strchr(name, '.');
#  462|   
#  463|   	if (!dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def118]
samba-4.24.0/source3/smbd/mangle_hash2.c: scope_hint: In function ‘hash2_name_to_8_3’
samba-4.24.0/source3/smbd/mangle_hash2.c:705:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  705 |         dot_p = strrchr(name, '.');
#      |               ^
#  703|   
#  704|   	/* find the '.' if any */
#  705|-> 	dot_p = strrchr(name, '.');
#  706|   
#  707|   	if (dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def119]
samba-4.24.0/source3/smbd/mangle_hash2.c:705:15: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  703|   
#  704|   	/* find the '.' if any */
#  705|-> 	dot_p = strrchr(name, '.');
#  706|   
#  707|   	if (dot_p) {

Error: COMPILER_WARNING (CWE-704): [#def120]
samba-4.24.0/source3/smbd/msdfs.c: scope_hint: In function ‘parse_dfs_path_strict’
samba-4.24.0/source3/smbd/msdfs.c:136:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  136 |         p = strchr(servicename, '\\');
#      |           ^
#  134|   	 */
#  135|   
#  136|-> 	p = strchr(servicename, '\\');
#  137|   	if (p != NULL) {
#  138|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def121]
samba-4.24.0/source3/smbd/msdfs.c:136:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  134|   	 */
#  135|   
#  136|-> 	p = strchr(servicename, '\\');
#  137|   	if (p != NULL) {
#  138|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def122]
samba-4.24.0/source3/utils/net_rpc.c: scope_hint: In function ‘get_user_tokens’
samba-4.24.0/source3/utils/net_rpc.c:5047:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5047 |                 p = strchr(users[i], *lp_winbind_separator());
#      |                   ^
# 5045|   		fstrcpy(result[i].name, users[i]);
# 5046|   
# 5047|-> 		p = strchr(users[i], *lp_winbind_separator());
# 5048|   
# 5049|   		DEBUG(3, ("%s\n", users[i]));

Error: COMPILER_WARNING (CWE-704): [#def123]
samba-4.24.0/source3/utils/net_rpc.c:5047:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5045|   		fstrcpy(result[i].name, users[i]);
# 5046|   
# 5047|-> 		p = strchr(users[i], *lp_winbind_separator());
# 5048|   
# 5049|   		DEBUG(3, ("%s\n", users[i]));

Error: COMPILER_WARNING (CWE-704): [#def124]
samba-4.24.0/source3/utils/ntlm_auth.c: scope_hint: In function ‘parse_ntlm_auth_domain_user’
samba-4.24.0/source3/utils/ntlm_auth.c:389:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  389 |         char *p = strchr(domuser,winbind_separator());
#      |                   ^~~~~~
#  387|   {
#  388|   
#  389|-> 	char *p = strchr(domuser,winbind_separator());
#  390|   
#  391|   	if (!p) {

Error: COMPILER_WARNING (CWE-704): [#def125]
samba-4.24.0/source3/utils/ntlm_auth.c:389:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  387|   {
#  388|   
#  389|-> 	char *p = strchr(domuser,winbind_separator());
#  390|   
#  391|   	if (!p) {

Error: COMPILER_WARNING (CWE-704): [#def126]
samba-4.24.0/source3/winbindd/idmap_nss.c: scope_hint: In function ‘idmap_nss_unixids_to_sids’
samba-4.24.0/source3/winbindd/idmap_nss.c:248:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  248 |                         p = strstr(name, lp_winbind_separator());
#      |                           ^
#  246|   			const char *domuser = NULL;
#  247|   
#  248|-> 			p = strstr(name, lp_winbind_separator());
#  249|   			if (p != NULL) {
#  250|   				*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def127]
samba-4.24.0/source3/winbindd/idmap_nss.c:248:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  246|   			const char *domuser = NULL;
#  247|   
#  248|-> 			p = strstr(name, lp_winbind_separator());
#  249|   			if (p != NULL) {
#  250|   				*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def128]
samba-4.24.0/source3/winbindd/idmap_nss.c:255:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  255 |                                 p = strchr(name, '@');
#      |                                   ^
#  253|   				domuser = p + 1;
#  254|   			} else {
#  255|-> 				p = strchr(name, '@');
#  256|   				if (p != NULL) {
#  257|   					*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def129]
samba-4.24.0/source3/winbindd/idmap_nss.c:255:35: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  253|   				domuser = p + 1;
#  254|   			} else {
#  255|-> 				p = strchr(name, '@');
#  256|   				if (p != NULL) {
#  257|   					*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def130]
samba-4.24.0/source3/winbindd/idmap_tdb.c: scope_hint: In function ‘convert_fn’
samba-4.24.0/source3/winbindd/idmap_tdb.c:78:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   78 |         p = strchr((const char *)key.dptr, '/');
#      |           ^
#   76|   	DEBUG(10,("Converting %s\n", (const char *)key.dptr));
#   77|   
#   78|-> 	p = strchr((const char *)key.dptr, '/');
#   79|   	if (!p)
#   80|   		return 0;

Error: COMPILER_WARNING (CWE-704): [#def131]
samba-4.24.0/source3/winbindd/idmap_tdb.c:78:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   76|   	DEBUG(10,("Converting %s\n", (const char *)key.dptr));
#   77|   
#   78|-> 	p = strchr((const char *)key.dptr, '/');
#   79|   	if (!p)
#   80|   		return 0;

Error: COMPILER_WARNING (CWE-704): [#def132]
samba-4.24.0/source3/winbindd/nss_info.c: scope_hint: In function ‘parse_nss_parm’
samba-4.24.0/source3/winbindd/nss_info.c:100:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  100 |         p = strchr( config, ':' );
#      |           ^
#   98|   		return False;
#   99|   
#  100|-> 	p = strchr( config, ':' );
#  101|   
#  102|   	/* if no : then the string must be the backend name only */

Error: COMPILER_WARNING (CWE-704): [#def133]
samba-4.24.0/source3/winbindd/nss_info.c:100:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   98|   		return False;
#   99|   
#  100|-> 	p = strchr( config, ':' );
#  101|   
#  102|   	/* if no : then the string must be the backend name only */

Error: COMPILER_WARNING (CWE-704): [#def134]
samba-4.24.0/source3/winbindd/winbindd_pam.c: scope_hint: In function ‘generate_krb5_ccache’
samba-4.24.0/source3/winbindd/winbindd_pam.c:672:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  672 |                         p = strchr(type, '%');
#      |                           ^
#  670|   			char *p;
#  671|   
#  672|-> 			p = strchr(type, '%');
#  673|   			if (p != NULL) {
#  674|   

Error: COMPILER_WARNING (CWE-704): [#def135]
samba-4.24.0/source3/winbindd/winbindd_pam.c:672:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  670|   			char *p;
#  671|   
#  672|-> 			p = strchr(type, '%');
#  673|   			if (p != NULL) {
#  674|   

Error: COMPILER_WARNING (CWE-704): [#def136]
samba-4.24.0/source3/winbindd/winbindd_util.c: scope_hint: In function ‘parse_domain_user’
samba-4.24.0/source3/winbindd/winbindd_util.c:2002:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2002 |         p = strchr(domuser, *lp_winbind_separator());
#      |           ^
# 2000|   	}
# 2001|   
# 2002|-> 	p = strchr(domuser, *lp_winbind_separator());
# 2003|   	if (p != NULL) {
# 2004|   		user = talloc_strdup(ctx, p + 1);

Error: COMPILER_WARNING (CWE-704): [#def137]
samba-4.24.0/source3/winbindd/winbindd_util.c:2002:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2000|   	}
# 2001|   
# 2002|-> 	p = strchr(domuser, *lp_winbind_separator());
# 2003|   	if (p != NULL) {
# 2004|   		user = talloc_strdup(ctx, p + 1);

Error: COMPILER_WARNING (CWE-704): [#def138]
samba-4.24.0/source3/winbindd/winbindd_util.c:2021:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2021 |                 p = strchr(domuser, '@');
#      |                   ^
# 2019|   			goto fail;
# 2020|   		}
# 2021|-> 		p = strchr(domuser, '@');
# 2022|   		if (p != NULL) {
# 2023|   			/* upn */

Error: COMPILER_WARNING (CWE-704): [#def139]
samba-4.24.0/source3/winbindd/winbindd_util.c:2021:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 2019|   			goto fail;
# 2020|   		}
# 2021|-> 		p = strchr(domuser, '@');
# 2022|   		if (p != NULL) {
# 2023|   			/* upn */

Error: COMPILER_WARNING (CWE-704): [#def140]
samba-4.24.0/source4/dsdb/common/util.c: scope_hint: In function ‘samdb_forest_name’
samba-4.24.0/source4/dsdb/common/util.c:5867:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5867 |         p = strchr(forest_name, '/');
#      |           ^
# 5865|   	}
# 5866|   
# 5867|-> 	p = strchr(forest_name, '/');
# 5868|   	if (p) {
# 5869|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def141]
samba-4.24.0/source4/dsdb/common/util.c:5867:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5865|   	}
# 5866|   
# 5867|-> 	p = strchr(forest_name, '/');
# 5868|   	if (p) {
# 5869|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def142]
samba-4.24.0/source4/dsdb/common/util.c: scope_hint: In function ‘samdb_default_domain_name’
samba-4.24.0/source4/dsdb/common/util.c:5886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5886 |         p = strchr(domain_name, '/');
#      |           ^
# 5884|   	}
# 5885|   
# 5886|-> 	p = strchr(domain_name, '/');
# 5887|   	if (p) {
# 5888|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def143]
samba-4.24.0/source4/dsdb/common/util.c:5886:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 5884|   	}
# 5885|   
# 5886|-> 	p = strchr(domain_name, '/');
# 5887|   	if (p) {
# 5888|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def144]
samba-4.24.0/source4/dsdb/samdb/cracknames.c: scope_hint: In function ‘DsCrackNameOneFilter’
samba-4.24.0/source4/dsdb/samdb/cracknames.c:1196:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1196 |         p = strchr(info1->dns_domain_name, '/');
#      |           ^
# 1194|   	info1->dns_domain_name = ldb_dn_canonical_string(mem_ctx, result->dn);
# 1195|   	W_ERROR_HAVE_NO_MEMORY(info1->dns_domain_name);
# 1196|-> 	p = strchr(info1->dns_domain_name, '/');
# 1197|   	if (p) {
# 1198|   		p[0] = '\0';

Error: COMPILER_WARNING (CWE-704): [#def145]
samba-4.24.0/source4/dsdb/samdb/cracknames.c:1196:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1194|   	info1->dns_domain_name = ldb_dn_canonical_string(mem_ctx, result->dn);
# 1195|   	W_ERROR_HAVE_NO_MEMORY(info1->dns_domain_name);
# 1196|-> 	p = strchr(info1->dns_domain_name, '/');
# 1197|   	if (p) {
# 1198|   		p[0] = '\0';

Error: COMPILER_WARNING (CWE-704): [#def146]
samba-4.24.0/source4/dsdb/samdb/cracknames.c: scope_hint: In function ‘crack_name_to_nt4_name’
samba-4.24.0/source4/dsdb/samdb/cracknames.c:1576:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1576 |         p = strchr(*nt4_domain, '\\');
#      |           ^
# 1574|   	}
# 1575|   
# 1576|-> 	p = strchr(*nt4_domain, '\\');
# 1577|   	if (!p) {
# 1578|   		return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def147]
samba-4.24.0/source4/dsdb/samdb/cracknames.c:1576:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1574|   	}
# 1575|   
# 1576|-> 	p = strchr(*nt4_domain, '\\');
# 1577|   	if (!p) {
# 1578|   		return NT_STATUS_INVALID_PARAMETER;

Error: COMPILER_WARNING (CWE-704): [#def148]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c: scope_hint: In function ‘get_key_directory’
samba-4.24.0/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c:128:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  128 |         p = strrchr(private_dir, '/');
#      |           ^
#  126|   	}
#  127|   
#  128|-> 	p = strrchr(private_dir, '/');
#  129|   	if (p != NULL) {
#  130|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def149]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/encrypted_secrets.c:128:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  126|   	}
#  127|   
#  128|-> 	p = strrchr(private_dir, '/');
#  129|   	if (p != NULL) {
#  130|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def150]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/partition_init.c: scope_hint: In function ‘partition_load_modules’
samba-4.24.0/source4/dsdb/samdb/ldb_modules/partition_init.c:106:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  106 |                 p = strchr((const char *)dn_blob.data, ':');
#      |                   ^
#  104|   		dn_blob = modules_attributes->values[i];
#  105|   
#  106|-> 		p = strchr((const char *)dn_blob.data, ':');
#  107|   		if (!p) {
#  108|   			ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def151]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/partition_init.c:106:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  104|   		dn_blob = modules_attributes->values[i];
#  105|   
#  106|-> 		p = strchr((const char *)dn_blob.data, ':');
#  107|   		if (!p) {
#  108|   			ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def152]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/partition_init.c: scope_hint: In function ‘partition_reload_if_required’
samba-4.24.0/source4/dsdb/samdb/ldb_modules/partition_init.c:460:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  460 |                         char *p = strrchr((const char *)dn_blob.data, ':');
#      |                                   ^~~~~~~
#  458|   
#  459|   			/* Look for DN:filename.ldb */
#  460|-> 			char *p = strrchr((const char *)dn_blob.data, ':');
#  461|   			if (!p) {
#  462|   				ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def153]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/partition_init.c:460:35: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  458|   
#  459|   			/* Look for DN:filename.ldb */
#  460|-> 			char *p = strrchr((const char *)dn_blob.data, ':');
#  461|   			if (!p) {
#  462|   				ldb_asprintf_errstring(ldb, 

Error: COMPILER_WARNING (CWE-704): [#def154]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/ranged_results.c: scope_hint: In function ‘rr_search_callback’
samba-4.24.0/source4/dsdb/samdb/ldb_modules/ranged_results.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  123 |                 p = strchr(ac->req->op.search.attrs[i], ';');
#      |                   ^
#  121|   		struct ldb_val *orig_values;
#  122|   
#  123|-> 		p = strchr(ac->req->op.search.attrs[i], ';');
#  124|   		if (!p) {
#  125|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def155]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/ranged_results.c:123:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  121|   		struct ldb_val *orig_values;
#  122|   
#  123|-> 		p = strchr(ac->req->op.search.attrs[i], ';');
#  124|   		if (!p) {
#  125|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def156]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/ranged_results.c: scope_hint: In function ‘rr_search’
samba-4.24.0/source4/dsdb/samdb/ldb_modules/ranged_results.c:230:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  230 |                 p = strchr(new_attrs[i], ';');
#      |                   ^
#  228|   		new_attrs[i] = req->op.search.attrs[i];
#  229|   		new_attrs[i+1] = NULL;
#  230|-> 		p = strchr(new_attrs[i], ';');
#  231|   		if (!p) {
#  232|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def157]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/ranged_results.c:230:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  228|   		new_attrs[i] = req->op.search.attrs[i];
#  229|   		new_attrs[i+1] = NULL;
#  230|-> 		p = strchr(new_attrs[i], ';');
#  231|   		if (!p) {
#  232|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def158]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/rootdse.c: scope_hint: In function ‘get_optional_feature_dn_guid’
samba-4.24.0/source4/dsdb/samdb/ldb_modules/rootdse.c:1159:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1159 |         guid = strchr(ldb_val_str, ':');
#      |              ^
# 1157|   	}
# 1158|   
# 1159|-> 	guid = strchr(ldb_val_str, ':');
# 1160|   	if (!guid) {
# 1161|   		ldb_set_errstring(ldb,

Error: COMPILER_WARNING (CWE-704): [#def159]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/rootdse.c:1159:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1157|   	}
# 1158|   
# 1159|-> 	guid = strchr(ldb_val_str, ':');
# 1160|   	if (!guid) {
# 1161|   		ldb_set_errstring(ldb,

Error: COMPILER_WARNING (CWE-704): [#def160]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/samldb.c: scope_hint: In function ‘check_spn_alias_collision’
samba-4.24.0/source4/dsdb/samdb/ldb_modules/samldb.c:3843:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3843 |         p = strchr(spn, '/');
#      |           ^
# 3841|   	 *    spn_tail      = "example.com/xxx"
# 3842|   	 */
# 3843|-> 	p = strchr(spn, '/');
# 3844|   	if (p == NULL) {
# 3845|   		/* bad SPN */

Error: COMPILER_WARNING (CWE-704): [#def161]
samba-4.24.0/source4/dsdb/samdb/ldb_modules/samldb.c:3843:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 3841|   	 *    spn_tail      = "example.com/xxx"
# 3842|   	 */
# 3843|-> 	p = strchr(spn, '/');
# 3844|   	if (p == NULL) {
# 3845|   		/* bad SPN */

Error: COMPILER_WARNING (CWE-704): [#def162]
samba-4.24.0/source4/lib/registry/util.c: scope_hint: In function ‘reg_strhex_to_data_blob’
samba-4.24.0/source4/lib/registry/util.c:98:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   98 |                 hi = strchr(HEXCHARS, toupper(str[i]));
#      |                    ^
#   96|   	j = 0;
#   97|   	for (i = 0; i < strlen(str); i++) {
#   98|-> 		hi = strchr(HEXCHARS, toupper(str[i]));
#   99|   		if (hi == NULL)
#  100|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def163]
samba-4.24.0/source4/lib/registry/util.c:98:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   96|   	j = 0;
#   97|   	for (i = 0; i < strlen(str); i++) {
#   98|-> 		hi = strchr(HEXCHARS, toupper(str[i]));
#   99|   		if (hi == NULL)
#  100|   			continue;

Error: COMPILER_WARNING (CWE-704): [#def164]
samba-4.24.0/source4/lib/registry/util.c:103:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  103 |                 lo = strchr(HEXCHARS, toupper(str[i]));
#      |                    ^
#  101|   
#  102|   		i++;
#  103|-> 		lo = strchr(HEXCHARS, toupper(str[i]));
#  104|   		if (lo == NULL)
#  105|   			break;

Error: COMPILER_WARNING (CWE-704): [#def165]
samba-4.24.0/source4/lib/registry/util.c:103:20: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  101|   
#  102|   		i++;
#  103|-> 		lo = strchr(HEXCHARS, toupper(str[i]));
#  104|   		if (lo == NULL)
#  105|   			break;

Error: COMPILER_WARNING (CWE-704): [#def166]
samba-4.24.0/source4/nbt_server/wins/winsdb.c: scope_hint: In function ‘winsdb_addr_decode’
samba-4.24.0/source4/nbt_server/wins/winsdb.c:235:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  235 |         p = strchr(address, ';');
#      |           ^
#  233|   	address = (char *)val->data;
#  234|   
#  235|-> 	p = strchr(address, ';');
#  236|   	if (!p) {
#  237|   		/* support old entries, with only the address */

Error: COMPILER_WARNING (CWE-704): [#def167]
samba-4.24.0/source4/nbt_server/wins/winsdb.c:235:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  233|   	address = (char *)val->data;
#  234|   
#  235|-> 	p = strchr(address, ';');
#  236|   	if (!p) {
#  237|   		/* support old entries, with only the address */

Error: COMPILER_WARNING (CWE-704): [#def168]
samba-4.24.0/source4/nbt_server/wins/winsdb.c:261:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  261 |         p = strchr(wins_owner, ';');
#      |           ^
#  259|   	}
#  260|   	wins_owner = p + 10;
#  261|-> 	p = strchr(wins_owner, ';');
#  262|   	if (!p) {
#  263|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: COMPILER_WARNING (CWE-704): [#def169]
samba-4.24.0/source4/nbt_server/wins/winsdb.c:261:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  259|   	}
#  260|   	wins_owner = p + 10;
#  261|-> 	p = strchr(wins_owner, ';');
#  262|   	if (!p) {
#  263|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: COMPILER_WARNING (CWE-704): [#def170]
samba-4.24.0/source4/nbt_server/wins/winsdb.c:283:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  283 |         p = strchr(expire_time, ';');
#      |           ^
#  281|   
#  282|   	expire_time = p + 11;
#  283|-> 	p = strchr(expire_time, ';');
#  284|   	if (!p) {
#  285|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: COMPILER_WARNING (CWE-704): [#def171]
samba-4.24.0/source4/nbt_server/wins/winsdb.c:283:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  281|   
#  282|   	expire_time = p + 11;
#  283|-> 	p = strchr(expire_time, ';');
#  284|   	if (!p) {
#  285|   		status = NT_STATUS_INTERNAL_DB_CORRUPTION;

Error: COMPILER_WARNING (CWE-704): [#def172]
samba-4.24.0/source4/rpc_server/lsa/lsa_init.c: scope_hint: In function ‘dcesrv_lsa_get_policy_state’
samba-4.24.0/source4/rpc_server/lsa/lsa_init.c:126:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  126 |         p = strchr(state->domain_dns, '/');
#      |           ^
#  124|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  125|   	}
#  126|-> 	p = strchr(state->domain_dns, '/');
#  127|   	if (p) {
#  128|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def173]
samba-4.24.0/source4/rpc_server/lsa/lsa_init.c:126:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  124|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  125|   	}
#  126|-> 	p = strchr(state->domain_dns, '/');
#  127|   	if (p) {
#  128|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def174]
samba-4.24.0/source4/rpc_server/lsa/lsa_init.c:135:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  135 |         p = strchr(state->forest_dns, '/');
#      |           ^
#  133|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  134|   	}
#  135|-> 	p = strchr(state->forest_dns, '/');
#  136|   	if (p) {
#  137|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def175]
samba-4.24.0/source4/rpc_server/lsa/lsa_init.c:135:11: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  133|   		return NT_STATUS_NO_SUCH_DOMAIN;
#  134|   	}
#  135|-> 	p = strchr(state->forest_dns, '/');
#  136|   	if (p) {
#  137|   		*p = '\0';

Error: COMPILER_WARNING (CWE-704): [#def176]
samba-4.24.0/source4/rpc_server/lsa/lsa_lookup.c: scope_hint: In function ‘dcesrv_lsa_LookupNames_base_call’
samba-4.24.0/source4/rpc_server/lsa/lsa_lookup.c:999:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  999 |                 p = strchr(item->name, '\\');
#      |                   ^
#  997|   
#  998|   		item->hints.principal = item->name;
#  999|-> 		p = strchr(item->name, '\\');
# 1000|   		if (p != NULL && p != item->name) {
# 1001|   			item->hints.domain = talloc_strndup(state->items,

Error: COMPILER_WARNING (CWE-704): [#def177]
samba-4.24.0/source4/rpc_server/lsa/lsa_lookup.c:999:19: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  997|   
#  998|   		item->hints.principal = item->name;
#  999|-> 		p = strchr(item->name, '\\');
# 1000|   		if (p != NULL && p != item->name) {
# 1001|   			item->hints.domain = talloc_strndup(state->items,

Error: COMPILER_WARNING (CWE-704): [#def178]
samba-4.24.0/source4/rpc_server/lsa/lsa_lookup.c:1019:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1019 |                         p = strchr(item->name, '@');
#      |                           ^
# 1017|   		}
# 1018|   		if (item->hints.domain == NULL) {
# 1019|-> 			p = strchr(item->name, '@');
# 1020|   			if (p != NULL && p != item->name && p[1] != '\0') {
# 1021|   				item->hints.namespace = p + 1;

Error: COMPILER_WARNING (CWE-704): [#def179]
samba-4.24.0/source4/rpc_server/lsa/lsa_lookup.c:1019:27: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
# 1017|   		}
# 1018|   		if (item->hints.domain == NULL) {
# 1019|-> 			p = strchr(item->name, '@');
# 1020|   			if (p != NULL && p != item->name && p[1] != '\0') {
# 1021|   				item->hints.namespace = p + 1;

Error: COMPILER_WARNING (CWE-704): [#def180]
samba-4.24.0/source4/torture/raw/qfileinfo.c: scope_hint: In function ‘torture_raw_qfileinfo_internals’
samba-4.24.0/source4/torture/raw/qfileinfo.c:811:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  811 |                 char *p = strrchr(s1->all_info.out.fname.s, '\\');
#      |                           ^~~~~~~
#  809|   	}
#  810|   	if (s1 && s1->all_info.out.fname.s) {
#  811|-> 		char *p = strrchr(s1->all_info.out.fname.s, '\\');
#  812|   		if (!p) {
#  813|   			printf("Not a full path in all_info/fname? - '%s'\n",

Error: COMPILER_WARNING (CWE-704): [#def181]
samba-4.24.0/source4/torture/raw/qfileinfo.c:811:27: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  809|   	}
#  810|   	if (s1 && s1->all_info.out.fname.s) {
#  811|-> 		char *p = strrchr(s1->all_info.out.fname.s, '\\');
#  812|   		if (!p) {
#  813|   			printf("Not a full path in all_info/fname? - '%s'\n",

Error: COMPILER_WARNING (CWE-704): [#def182]
samba-4.24.0/source4/torture/winbind/struct_based.c: scope_hint: In function ‘parse_domain_user’
samba-4.24.0/source4/torture/winbind/struct_based.c:812:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  812 |         char *p = strchr(domuser, winbind_separator(torture));
#      |                   ^~~~~~
#  810|   			      fstring user)
#  811|   {
#  812|-> 	char *p = strchr(domuser, winbind_separator(torture));
#  813|   	char *dom = NULL;
#  814|   

Error: COMPILER_WARNING (CWE-704): [#def183]
samba-4.24.0/source4/torture/winbind/struct_based.c:812:19: warning[-Wdiscarded-qualifiers]: initialization discards ‘const’ qualifier from pointer target type
#  810|   			      fstring user)
#  811|   {
#  812|-> 	char *p = strchr(domuser, winbind_separator(torture));
#  813|   	char *dom = NULL;
#  814|   

Error: COMPILER_WARNING (CWE-704): [#def184]
samba-4.24.0/source4/torture/winbind/struct_based.c:817:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  817 |                 if ((p = strchr(domuser, '@')) != NULL) {
#      |                        ^
#  815|   	if (!p) {
#  816|   		/* Maybe it was a UPN? */
#  817|-> 		if ((p = strchr(domuser, '@')) != NULL) {
#  818|   			fstrcpy(domain, "");
#  819|   			fstrcpy(user, domuser);

Error: COMPILER_WARNING (CWE-704): [#def185]
samba-4.24.0/source4/torture/winbind/struct_based.c:817:24: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#  815|   	if (!p) {
#  816|   		/* Maybe it was a UPN? */
#  817|-> 		if ((p = strchr(domuser, '@')) != NULL) {
#  818|   			fstrcpy(domain, "");
#  819|   			fstrcpy(user, domuser);

Error: COMPILER_WARNING (CWE-704): [#def186]
samba-4.24.0/source4/utils/oLschema2ldif/lib.c: scope_hint: In function ‘check_braces’
samba-4.24.0/source4/utils/oLschema2ldif/lib.c:70:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   70 |         if ((c = strchr(string, '(')) == NULL) {
#      |                ^
#   68|   
#   69|   	b = 0;
#   70|-> 	if ((c = strchr(string, '(')) == NULL) {
#   71|   		return -1;
#   72|   	}

Error: COMPILER_WARNING (CWE-704): [#def187]
samba-4.24.0/source4/utils/oLschema2ldif/lib.c:70:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type
#   68|   
#   69|   	b = 0;
#   70|-> 	if ((c = strchr(string, '(')) == NULL) {
#   71|   		return -1;
#   72|   	}

Scan Properties

analyzer-version-clippy1.97.1
analyzer-version-cppcheck2.21.1
analyzer-version-gcc16.1.1
analyzer-version-gcc-analyzer16.1.1
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.97.1
diffbase-analyzer-version-cppcheck2.21.1
diffbase-analyzer-version-gcc16.1.1
diffbase-analyzer-version-gcc-analyzer16.1.1
diffbase-analyzer-version-shellcheck0.11.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-229.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namesamba-4.24.4-4.fc45
diffbase-store-results-to/tmp/tmpqo3wa5p8/samba-4.24.4-4.fc45.tar.xz
diffbase-time-created2026-08-03 21:25:37
diffbase-time-finished2026-08-03 22:06:11
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmpqo3wa5p8/samba-4.24.4-4.fc45.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpqo3wa5p8/samba-4.24.4-4.fc45.src.rpm'
diffbase-tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-229.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20260524.213755.g3c6d0be.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namesamba-4.24.0-6.fc44
store-results-to/tmp/tmphkfu896n/samba-4.24.0-6.fc44.tar.xz
time-created2026-08-03 20:44:48
time-finished2026-08-03 21:24:44
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,clippy,unicontrol,shellcheck,cppcheck' '-o' '/tmp/tmphkfu896n/samba-4.24.0-6.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmphkfu896n/samba-4.24.0-6.fc44.src.rpm'
tool-versioncsmock-3.8.7.20260803.142340.gb75b18e-1.el9