s3:winbind: Fix possible NULL pointer dereference
authorAndreas Schneider <asn@samba.org>
Tue, 23 Nov 2021 14:48:57 +0000 (15:48 +0100)
committerJule Anger <janger@samba.org>
Thu, 2 Dec 2021 11:38:42 +0000 (11:38 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14921
BUG: https://bugzilla.redhat.com/show_bug.cgi?id=2019888

Signed-off-by: Andreas Schneider <asn@samba.org>
Rewiewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit cbf312f02bc86f9325fb89f6f5441bc61fd3974f)

Autobuild-User(v4-15-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-15-test): Thu Dec  2 11:38:42 UTC 2021 on sn-devel-184

source3/winbindd/winbindd_util.c

index a8c510fafc675c1090341c413736ba92ca2bfd2a..175e05ae3ad31a5289c886bf850270b47619f1e6 100644 (file)
@@ -1784,6 +1784,9 @@ char *fill_domain_username_talloc(TALLOC_CTX *mem_ctx,
        }
 
        tmp_user = talloc_strdup(mem_ctx, user);
+       if (tmp_user == NULL) {
+               return NULL;
+       }
        if (!strlower_m(tmp_user)) {
                TALLOC_FREE(tmp_user);
                return NULL;