From 2a6087c1864b3e3349d669fd22ab67b04d0fb0cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 18 Feb 2010 02:03:53 +0100 Subject: [PATCH 1/2] s3-spoolss: in spoolss_EnumPrinters r->in.server is a *unique* pointer! Guenther (cherry picked from commit 8ce66fba03f782c0b9948a9835bb488cfa74acf9) --- source3/rpc_server/srv_spoolss_nt.c | 8 +++++--- 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 92f37e5..7367536 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -4275,7 +4275,7 @@ static WERROR enumprinters_level5(TALLOC_CTX *mem_ctx, WERROR _spoolss_EnumPrinters(pipes_struct *p, struct spoolss_EnumPrinters *r) { - const char *name; + const char *name = NULL; WERROR result; /* that's an [in out] buffer */ @@ -4303,8 +4303,10 @@ WERROR _spoolss_EnumPrinters(pipes_struct *p, * Level 5: same as Level 2 */ - name = talloc_strdup_upper(p->mem_ctx, r->in.server); - W_ERROR_HAVE_NO_MEMORY(name); + if (name) { + name = talloc_strdup_upper(p->mem_ctx, r->in.server); + W_ERROR_HAVE_NO_MEMORY(name); + } switch (r->in.level) { case 0: -- 1.6.6.1 From 2598ed982c33c40848f97d70b64806ade11cb95e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Thu, 18 Feb 2010 12:40:00 +0100 Subject: [PATCH 2/2] s3-spoolss: Fix _spoolss_EnumPrinters servername handling. Guenther (cherry picked from commit b3c2b2260a503079b9abf22f6b35b56c61c2b372) --- source3/rpc_server/srv_spoolss_nt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 7367536..2b1a64f 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -4303,7 +4303,7 @@ WERROR _spoolss_EnumPrinters(pipes_struct *p, * Level 5: same as Level 2 */ - if (name) { + if (r->in.server) { name = talloc_strdup_upper(p->mem_ctx, r->in.server); W_ERROR_HAVE_NO_MEMORY(name); } -- 1.6.6.1