From 24c6400ce0b1b7064c4e89cae38662154671cd48 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 1 Mar 2019 15:48:18 +0100 Subject: [PATCH] ndr_spoolss_buf: fix out of scope use of stack variable in NDR_SPOOLSS_PUSH_ENUM_OUT() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BUG: https://bugzilla.samba.org/show_bug.cgi?id=13818 Signed-off-by: Stefan Metzmacher Reviewed-by: David Disseldorp Reviewed-by: Andreas Schneider Reviewed-by: Björn Jacke Reviewed-by: Günther Deschner Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam (cherry picked from commit 6da3664f8a11397fd3fb38e89c2432b8bf321e59) --- librpc/ndr/ndr_spoolss_buf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index c1d175fcbe5f..244d692dca8b 100644 --- a/librpc/ndr/ndr_spoolss_buf.c +++ b/librpc/ndr/ndr_spoolss_buf.c @@ -43,7 +43,8 @@ } while(0) #define NDR_SPOOLSS_PUSH_ENUM_OUT(fn) do { \ - struct ndr_push *_ndr_info;\ + DATA_BLOB _data_blob_info = data_blob_null;\ + struct ndr_push *_ndr_info = NULL;\ _r.in.level = r->in.level;\ _r.in.buffer = r->in.buffer;\ _r.in.offered = r->in.offered;\ @@ -56,7 +57,6 @@ "SPOOLSS Buffer: *r->out.info but there's no r->in.buffer");\ }\ if (r->in.buffer) {\ - DATA_BLOB _data_blob_info;\ _ndr_info = ndr_push_init_ctx(ndr);\ NDR_ERR_HAVE_NO_MEMORY(_ndr_info);\ _ndr_info->flags= ndr->flags;\ -- 2.17.1