From: Stefan Metzmacher Date: Thu, 30 Jan 2025 18:10:03 +0000 (+0100) Subject: s4:dsdb/common: check for valid netbios name length for trusts X-Git-Tag: tevent-0.17.0~828 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3b789aba91ebd90cb58e6c295ae589d3a5eb4af;p=thirdparty%2Fsamba.git s4:dsdb/common: check for valid netbios name length for trusts Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- 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;