mirror of
https://github.com/samba-team/samba.git
synced 2025-02-25 17:57:42 +03:00
s3:lib: Do not segfault if username is NULL
Found by covscan. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
13690569ee
commit
9297ac44f7
@ -112,11 +112,14 @@ void set_cmdline_auth_info_username(struct user_auth_info *auth_info,
|
||||
{
|
||||
const char *new_val = NULL;
|
||||
|
||||
if (username == NULL) {
|
||||
return;
|
||||
}
|
||||
cli_credentials_parse_string(auth_info->creds,
|
||||
username,
|
||||
CRED_SPECIFIED);
|
||||
new_val = cli_credentials_get_username(auth_info->creds);
|
||||
if (username != NULL && new_val == NULL) {
|
||||
if (new_val == NULL) {
|
||||
exit(ENOMEM);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user