From 3d9b1dd3552e33d555fe689d2a513f57014a15a3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 25 Aug 2025 12:59:32 +0200 Subject: [PATCH] winbindd: Simplify parse_domain_user() We have talloc_strndup() for this. Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Tue Sep 2 09:08:59 UTC 2025 on atb-devel-224 --- source3/winbindd/winbindd_util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 174ebcbdc3d..f7b68929bc9 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -2005,12 +2005,10 @@ bool parse_domain_user(TALLOC_CTX *ctx, if (user == NULL) { goto fail; } - domain = talloc_strdup(ctx, - domuser); + domain = talloc_strndup(ctx, domuser, p - domuser); if (domain == NULL) { goto fail; } - domain[PTR_DIFF(p, domuser)] = '\0'; namespace = talloc_strdup(ctx, domain); if (namespace == NULL) { goto fail; -- 2.47.3