1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

krb5_wrap: Do not return an empty realm from smb_krb5_get_realm_from_hostname()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12554

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andreas Schneider 2017-03-08 10:40:08 +01:00 committed by Andreas Schneider
parent 42bd003f46
commit 946f9dd117

View File

@ -2715,7 +2715,9 @@ static char *smb_krb5_get_realm_from_hostname(TALLOC_CTX *mem_ctx,
goto out;
}
if (realm_list && realm_list[0]) {
if (realm_list != NULL &&
realm_list[0] != NULL &&
realm_list[0][0] != '\0') {
realm = talloc_strdup(mem_ctx, realm_list[0]);
}