summaryrefslogtreecommitdiff
path: root/source3/libads/ldap_printer.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-21 18:04:47 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-21 18:04:47 +0200
commit20796bcf57a7f5e1921dc12e0568221f985fe4f2 (patch)
tree8f0540a602a9ea0031d656bc31c0b8bc1e91eb70 /source3/libads/ldap_printer.c
parent323be4a6907e4915bb76aa103bf5b868f0b459b1 (diff)
parent1a416ff13ca7786f2e8d24c66addf00883e9cb12 (diff)
downloadsamba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.tar.gz
samba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.tar.bz2
samba-20796bcf57a7f5e1921dc12e0568221f985fe4f2.zip
Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into docbook
Conflicts: source/Makefile.in (This used to be commit 01987778a123f853fccdcb7fe9566143e2d7c490)
Diffstat (limited to 'source3/libads/ldap_printer.c')
-rw-r--r--source3/libads/ldap_printer.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index 41f23b06a7..9935e2311a 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -103,17 +103,23 @@ static bool map_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
const REGISTRY_VALUE *value)
{
char *str_value = NULL;
+ size_t converted_size;
ADS_STATUS status;
if (value->type != REG_SZ)
- return False;
+ return false;
if (value->size && *((smb_ucs2_t *) value->data_p)) {
- pull_ucs2_talloc(ctx, &str_value, (const smb_ucs2_t *) value->data_p);
+ if (!pull_ucs2_talloc(ctx, &str_value,
+ (const smb_ucs2_t *) value->data_p,
+ &converted_size))
+ {
+ return false;
+ }
status = ads_mod_str(ctx, mods, value->valuename, str_value);
return ADS_ERR_OK(status);
}
- return True;
+ return true;
}
@@ -163,6 +169,7 @@ static bool map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
const REGISTRY_VALUE *value)
{
char **str_values = NULL;
+ size_t converted_size;
smb_ucs2_t *cur_str = (smb_ucs2_t *) value->data_p;
uint32 size = 0, num_vals = 0, i=0;
ADS_STATUS status;
@@ -185,9 +192,11 @@ static bool map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
(num_vals + 1) * sizeof(char *));
cur_str = (smb_ucs2_t *) value->data_p;
- for (i=0; i < num_vals; i++)
+ for (i=0; i < num_vals; i++) {
cur_str += pull_ucs2_talloc(ctx, &str_values[i],
- cur_str);
+ cur_str, &converted_size) ?
+ converted_size : (size_t)-1;
+ }
status = ads_mod_strlist(ctx, mods, value->valuename,
(const char **) str_values);