From: Isaac Boukris Date: Sat, 20 Jun 2020 15:17:33 +0000 (+0200) Subject: Fix usage of ldap_get_values_len for msDS-AdditionalDnsHostName X-Git-Tag: ldb-2.2.0~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9dd67355ba35539d7ae1774d5135fd05d747b3f;p=thirdparty%2Fsamba.git 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 --- diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 51ceb447254..36e73440495 100755 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -3707,8 +3707,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; }