From c4d6d75cf48aed7b17728e283581366143fa4233 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Thu, 6 Nov 2008 11:40:03 +0100 Subject: s3-libnetjoin: add machine_name length check. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guenther Signed-off-by: Günther Deschner Reviewed-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- source3/libnet/libnet_join.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source3') diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 4582158fca..df3a86d092 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -1715,6 +1715,15 @@ static WERROR libnet_join_pre_processing(TALLOC_CTX *mem_ctx, return WERR_INVALID_PARAM; } + if (strlen(r->in.machine_name) > 15) { + libnet_join_set_error_string(mem_ctx, r, + "Our netbios name can be at most 15 chars long, " + "\"%s\" is %u chars long\n", + r->in.machine_name, + (unsigned int)strlen(r->in.machine_name)); + return WERR_INVALID_PARAM; + } + if (!libnet_parse_domain_dc(mem_ctx, r->in.domain_name, &r->in.domain_name, &r->in.dc_name)) { -- cgit