From 846aa18648f3b34ab5cbc4dc4ba334bbedeab2f4 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 24 Nov 2009 15:22:04 +0100 Subject: s3-spoolss: fixes for _spoolss_EnumPrinterKey client and server. Thanks Metze for review! Guenther --- source3/rpc_client/cli_spoolss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source3/rpc_client/cli_spoolss.c') 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, -- cgit