summaryrefslogtreecommitdiff
path: root/source3/rpc_parse
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r--source3/rpc_parse/parse_reg.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/rpc_parse/parse_reg.c b/source3/rpc_parse/parse_reg.c
index 365ad2dc70..1387aaf6ea 100644
--- a/source3/rpc_parse/parse_reg.c
+++ b/source3/rpc_parse/parse_reg.c
@@ -39,6 +39,7 @@ static uint32 reg_init_buffer2( BUFFER2 *buf2, REGISTRY_VALUE *val )
char *string;
char *list = NULL;
char *list2 = NULL;
+ int len = 0;
if ( !buf2 || !val )
return 0;
@@ -48,10 +49,13 @@ static uint32 reg_init_buffer2( BUFFER2 *buf2, REGISTRY_VALUE *val )
switch (val->type )
{
case REG_SZ:
- string = (char*)val->data_p;
+ string = (char*)regval_data_p( val );
DEBUG(10,("reg_init_buffer2: REG_SZ string => [%s]\n", string));
- init_unistr2( &unistr, (char*)val->data_p, strlen((char*)val->data_p)+1 );
+ if ( string )
+ len = strlen(string)+1;
+
+ init_unistr2( &unistr, (char*)val->data_p, len );
init_buffer2( buf2, (char*)unistr.buffer, unistr.uni_str_len*2 );
real_size = unistr.uni_str_len*2;
break;