summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-03-15 14:41:58 +0100
committerGünther Deschner <gd@samba.org>2010-03-15 14:41:58 +0100
commitc9cc26ef620b6c46ba129ea07ce33892abf5931a (patch)
treeffb496065705f215b811b71a83385320ea4a6b22
parent06cbf05e8b964d353d0ca505ade7b018f93c8465 (diff)
downloadsamba-c9cc26ef620b6c46ba129ea07ce33892abf5931a.tar.gz
samba-c9cc26ef620b6c46ba129ea07ce33892abf5931a.tar.bz2
samba-c9cc26ef620b6c46ba129ea07ce33892abf5931a.zip
s3-spoolss: Fix _spoolss_EnumPrinterData.
Guenther
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 157a4e2bd3..0cf1e13328 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -7768,7 +7768,7 @@ WERROR _spoolss_EnumPrinterData(pipes_struct *p,
if (!r->out.value_name) {
return WERR_NOMEM;
}
- *r->out.value_needed = strlen_m(val->value_name);
+ *r->out.value_needed = val->value_name_len;
} else {
r->out.value_name = NULL;
*r->out.value_needed = 0;
@@ -7785,9 +7785,9 @@ WERROR _spoolss_EnumPrinterData(pipes_struct *p,
* in MS-RPRN.
*/
- if (r->out.data && val->data &&
+ if (r->out.data && val->data && val->data->data &&
val->data_length && r->in.data_offered) {
- memcpy(r->out.data, val->data,
+ memcpy(r->out.data, val->data->data,
MIN(val->data_length,r->in.data_offered));
}
@@ -9072,6 +9072,8 @@ static WERROR registry_value_to_printer_enum_value(TALLOC_CTX *mem_ctx,
r->value_name = talloc_strdup(mem_ctx, regval_name(v));
W_ERROR_HAVE_NO_MEMORY(r->value_name);
+ r->value_name_len = strlen_m_term(regval_name(v)) * 2;
+
r->type = regval_type(v);
r->data_length = regval_size(v);