From 26df81a00bf89ca00a3de2d9d3ede0599b55cd51 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 23 Nov 2021 15:48:57 +0100 Subject: [PATCH] s3:winbind: Fix possible NULL pointer dereference 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 Rewiewed-by: Jeremy Allison (cherry picked from commit cbf312f02bc86f9325fb89f6f5441bc61fd3974f) --- source3/winbindd/winbindd_util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index a8c510fafc6..175e05ae3ad 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -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; -- 2.34.1