From 43182fdff89bc5c238e7a90cf93500cef850ecd5 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Wed, 18 Mar 2009 21:36:40 +0100 Subject: s3-spoolss: fix _spoolss_EnumPrinterDataEx error path. When a windows clients queries the "" key, we need to make sure to return with the appropriate error (WERR_INVALID_PARAM in that case), and not fall through to the buffer size handling macros. Found by torture test. Guenther --- source3/rpc_server/srv_spoolss_nt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 0b9598840b..5e1c53905a 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -9141,6 +9141,10 @@ WERROR _spoolss_EnumPrinterDataEx(pipes_struct *p, free_a_printer(&printer, 2); } + if (!W_ERROR_IS_OK(result)) { + return result; + } + *r->out.needed = SPOOLSS_BUFFER_ARRAY(p->mem_ctx, spoolss_EnumPrinterDataEx, NULL, *r->out.info, -- cgit