summaryrefslogtreecommitdiff
path: root/source4/rpc_server/winreg
diff options
context:
space:
mode:
Diffstat (limited to 'source4/rpc_server/winreg')
-rw-r--r--source4/rpc_server/winreg/rpc_winreg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/rpc_server/winreg/rpc_winreg.c b/source4/rpc_server/winreg/rpc_winreg.c
index 20bf7f9117..56e5c427cc 100644
--- a/source4/rpc_server/winreg/rpc_winreg.c
+++ b/source4/rpc_server/winreg/rpc_winreg.c
@@ -360,10 +360,16 @@ static WERROR winreg_QueryValue(struct dcesrv_call_state *dce_call, TALLOC_CTX *
return result;
}
+ /* Just asking for the size of the buffer */
r->out.type = &val->data_type;
- r->out.size = r->in.size;
r->out.length = &val->data_len;
- r->out.data = val->data_blk;
+ if (!r->in.data) {
+ r->out.size = talloc_p(mem_ctx, uint32);
+ *r->out.size = val->data_len;
+ } else {
+ r->out.size = r->in.size;
+ r->out.data = val->data_blk;
+ }
return WERR_OK;
}