From b3b789aba91ebd90cb58e6c295ae589d3a5eb4af Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 30 Jan 2025 19:10:03 +0100 Subject: [PATCH] s4:dsdb/common: check for valid netbios name length for trusts Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source4/dsdb/common/util_trusts.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source4/dsdb/common/util_trusts.c b/source4/dsdb/common/util_trusts.c index 0502f10e793..1495019129a 100644 --- a/source4/dsdb/common/util_trusts.c +++ b/source4/dsdb/common/util_trusts.c @@ -1214,6 +1214,14 @@ NTSTATUS dsdb_trust_normalize_forest_info_step1(TALLOC_CTX *mem_ctx, return NT_STATUS_INVALID_PARAMETER; } + if (nnb != NULL && + (nnb->string == NULL || + strlen(nnb->string) > 15)) + { + TALLOC_FREE(frame); + return NT_STATUS_INVALID_PARAMETER; + } + for (c = 0; c < n; c++) { const struct lsa_ForestTrustRecord *cftr = nfti->entries[c]; const struct lsa_ForestTrustDomainInfo *cinfo = NULL; -- 2.47.2