]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb/common: check for valid netbios name length for trusts
authorStefan Metzmacher <metze@samba.org>
Thu, 30 Jan 2025 18:10:03 +0000 (19:10 +0100)
committerRalph Boehme <slow@samba.org>
Sat, 8 Feb 2025 15:26:38 +0000 (15:26 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/dsdb/common/util_trusts.c

index 0502f10e7930e5685a586d00fa928068b0168c31..1495019129a6981c5f2676b3706c321359620ea6 100644 (file)
@@ -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;