From 946f9dd1170be63b91e31ce825ea123f3c07329b Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 8 Mar 2017 10:40:08 +0100 Subject: [PATCH] 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 Signed-off-by: Andreas Schneider Signed-off-by: Stefan Metzmacher --- lib/krb5_wrap/krb5_samba.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c index 8ebf601689b..780a7a4adf5 100644 --- a/lib/krb5_wrap/krb5_samba.c +++ b/lib/krb5_wrap/krb5_samba.c @@ -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]); }