From: Andreas Schneider Date: Wed, 11 Nov 2020 12:42:06 +0000 (+0100) Subject: s3:smbd: Fix possible null pointer dereference in token_contains_name() X-Git-Tag: samba-4.14.0rc1~632 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8036bf9717f83e83c3e4a9cf00fded42e9a5de15;p=thirdparty%2Fsamba.git s3:smbd: Fix possible null pointer dereference in token_contains_name() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14572 Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy Autobuild-User(master): Alexander Bokovoy Autobuild-Date(master): Thu Nov 12 15:13:47 UTC 2020 on sn-devel-184 --- diff --git a/source3/smbd/share_access.c b/source3/smbd/share_access.c index 57754a0f766..694c0c290e8 100644 --- a/source3/smbd/share_access.c +++ b/source3/smbd/share_access.c @@ -79,7 +79,7 @@ static bool token_contains_name(TALLOC_CTX *mem_ctx, enum lsa_SidType type; if (username != NULL) { - size_t domain_len = strlen(domain); + size_t domain_len = domain != NULL ? strlen(domain) : 0; /* Check if username starts with domain name */ if (domain_len > 0) {