summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-11-24 15:22:04 +0100
committerGünther Deschner <gd@samba.org>2009-11-24 15:49:35 +0100
commit846aa18648f3b34ab5cbc4dc4ba334bbedeab2f4 (patch)
treecbe1f28f1d0ce5aeb3d039d3b2a00053fc1ec5cb /source3
parent2707dfb441801e753c74657f20b5ca22a274778f (diff)
downloadsamba-846aa18648f3b34ab5cbc4dc4ba334bbedeab2f4.tar.gz
samba-846aa18648f3b34ab5cbc4dc4ba334bbedeab2f4.tar.bz2
samba-846aa18648f3b34ab5cbc4dc4ba334bbedeab2f4.zip
s3-spoolss: fixes for _spoolss_EnumPrinterKey client and server.
Thanks Metze for review! Guenther
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_spoolss.c4
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 2dba103069..6d6d5dfcfa 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -815,7 +815,7 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
*key_buffer = NULL;
if (offered) {
- buffer = talloc_array(mem_ctx, uint16_t, offered);
+ buffer = talloc_array(mem_ctx, uint16_t, offered/2);
W_ERROR_HAVE_NO_MEMORY(buffer);
}
@@ -829,7 +829,7 @@ WERROR rpccli_spoolss_enumprinterkey(struct rpc_pipe_client *cli,
if (W_ERROR_EQUAL(werror, WERR_MORE_DATA)) {
offered = needed;
- buffer = talloc_realloc(mem_ctx, buffer, uint16_t, needed);
+ buffer = talloc_realloc(mem_ctx, buffer, uint16_t, needed/2);
W_ERROR_HAVE_NO_MEMORY(buffer);
status = rpccli_spoolss_EnumPrinterKey(cli, mem_ctx,
handle,
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 072090b14a..703dca15e8 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -9203,7 +9203,7 @@ WERROR _spoolss_EnumPrinterKey(pipes_struct *p,
goto done;
}
- if (r->in.offered == blob.length) {
+ if (r->in.offered >= blob.length) {
memcpy(r->out.key_buffer, blob.data, blob.length);
}