ndr_spoolss_buf: fix out of scope use of stack variable in NDR_SPOOLSS_PUSH_ENUM_OUT()
authorStefan Metzmacher <metze@samba.org>
Fri, 1 Mar 2019 14:48:18 +0000 (15:48 +0100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 6 Mar 2019 03:16:14 +0000 (03:16 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13818

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Björn Jacke <bjacke@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
librpc/ndr/ndr_spoolss_buf.c

index c1d175fcbe5f37c4082f82f41e720d8c911d03a6..244d692dca8bc1c210886276d5aa6a1215029219 100644 (file)
@@ -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;\