summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index b1513dd329..e2e523d0de 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -7634,8 +7634,15 @@ WERROR _spoolss_EnumPrinterData(pipes_struct *p,
/* data - counted in bytes */
- if (r->out.data && regval_size(val)) {
- memcpy(r->out.data, regval_data_p(val), regval_size(val));
+ /*
+ * See the section "Dynamically Typed Query Parameters"
+ * in MS-RPRN.
+ */
+
+ if (r->out.data && regval_data_p(val) &&
+ regval_size(val) && r->in.data_offered) {
+ memcpy(r->out.data, regval_data_p(val),
+ MIN(regval_size(val),r->in.data_offered));
}
*r->out.data_needed = regval_size(val);