summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2017-02-17 11:53:52 +0100
committerJeremy Allison <jra@samba.org>2017-02-23 03:18:10 +0100
commit1df1d873c849f68a91d067c7049dda12c22e98c5 (patch)
treed14cb846cf7061b19a74fa1364a51df378d29008 /nsswitch
parent9297ac44f7e0455bb74ee77ad8b68f2e8c4a070d (diff)
downloadsamba-1df1d873c849f68a91d067c7049dda12c22e98c5.tar.gz
pam_winbind: Return if we do not have a domain
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>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/pam_winbind.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index 859101fcd79..746b157919e 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -2479,10 +2479,14 @@ static char* winbind_upn_to_username(struct pwb_context *ctx,
if (!name) {
return NULL;
}
- if ((p = strchr(name, '@')) != NULL) {
- *p = 0;
- domain = p + 1;
+
+ p = strchr(name, '@');
+ if (p == NULL) {
+ TALLOC_FREE(name);
+ return NULL;
}
+ *p = '\0';
+ domain = p + 1;
/* Convert the UPN to a SID */