]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix usage of ldap_get_values_len for msDS-AdditionalDnsHostName
authorIsaac Boukris <iboukris@gmail.com>
Sat, 20 Jun 2020 15:17:33 +0000 (17:17 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Mon, 22 Jun 2020 09:59:04 +0000 (09:59 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14406

Signed-off-by: Isaac Boukris <iboukris@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Mon Jun 22 09:59:04 UTC 2020 on sn-devel-184

source3/libads/ldap.c

index 51ceb44725422101a3bee0d56dca0c41abab7fa0..36e7344049529f01bf4f23666683057a3165d527 100755 (executable)
@@ -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;
                }