From: Stefan Metzmacher Date: Fri, 1 Mar 2019 14:48:18 +0000 (+0100) Subject: ndr_spoolss_buf: fix out of scope use of stack variable in NDR_SPOOLSS_PUSH_ENUM_OUT() X-Git-Tag: samba-4.8.10~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c7e7ea8d9539ce8bd37887092aa8130642969154;p=thirdparty%2Fsamba.git ndr_spoolss_buf: fix out of scope use of stack variable in NDR_SPOOLSS_PUSH_ENUM_OUT() 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) --- diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c index c1d175fcbe5..244d692dca8 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;\