From 0ac77960440f69e47ad52f134ecc95133c3c2353 Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Sat, 20 Jun 2020 17:17:33 +0200 Subject: [PATCH] Fix usage of ldap_get_values_len for msDS-AdditionalDnsHostName BUG: https://bugzilla.samba.org/show_bug.cgi?id=14406 Signed-off-by: Isaac Boukris Reviewed-by: Andreas Schneider Autobuild-User(master): Andreas Schneider Autobuild-Date(master): Mon Jun 22 09:59:04 UTC 2020 on sn-devel-184 --- source3/libads/ldap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index ed52d4a969e..7ef7e7e8420 100755 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -3691,8 +3691,12 @@ static char **get_addl_hosts(ADS_STRUCT *ads, TALLOC_CTX *mem_ctx, } for (i = 0; i < *num_values; i++) { - if (!pull_utf8_talloc(mem_ctx, &ret[i], values[i]->bv_val, - &converted_size)) { + ret[i] = NULL; + if (!convert_string_talloc(mem_ctx, CH_UTF8, CH_UNIX, + values[i]->bv_val, + strnlen(values[i]->bv_val, + values[i]->bv_len), + &ret[i], &converted_size)) { ldap_value_free_len(values); return NULL; } -- 2.11.4.GIT