summaryrefslogtreecommitdiff
path: root/source4/lib/registry/common/reg_util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/registry/common/reg_util.c')
-rw-r--r--source4/lib/registry/common/reg_util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/lib/registry/common/reg_util.c b/source4/lib/registry/common/reg_util.c
index 5ca104fc2e..82b8d06679 100644
--- a/source4/lib/registry/common/reg_util.c
+++ b/source4/lib/registry/common/reg_util.c
@@ -45,10 +45,10 @@ char *reg_val_data_string(REG_VAL *v)
switch (reg_val_type(v)) {
case REG_SZ:
/* FIXME: Convert to ascii */
- return strdup(reg_val_data_blk(v));
+ return strndup(reg_val_data_blk(v), reg_val_size(v));
case REG_EXPAND_SZ:
- return strdup(reg_val_data_blk(v));
+ return strndup(reg_val_data_blk(v), reg_val_size(v));
case REG_BINARY:
ret = malloc(reg_val_size(v) * 3 + 2);