]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smbd: Fix possible null pointer dereference in token_contains_name()
authorAndreas Schneider <asn@samba.org>
Wed, 11 Nov 2020 12:42:06 +0000 (13:42 +0100)
committerAlexander Bokovoy <ab@samba.org>
Thu, 12 Nov 2020 15:13:47 +0000 (15:13 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14572

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Thu Nov 12 15:13:47 UTC 2020 on sn-devel-184

source3/smbd/share_access.c

index 57754a0f7663b9e19195af5509177b68d060a932..694c0c290e8173d7dbb608761f8128d1ba289b71 100644 (file)
@@ -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) {