From c89c8b9d5064db51bf127bed07ce28b017602f32 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 29 Aug 2005 17:48:01 +0000 Subject: [PATCH] r9752: figured out why talloc_steal() is a bad idea for SEC_DESC* Add a comment so someone else doesn't get bitten by this as well. --- source/rpc_server/srv_spoolss_nt.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index ee35b5853fe..33eeec91de6 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/rpc_server/srv_spoolss_nt.c @@ -4171,7 +4171,11 @@ static BOOL construct_printer_info_2(Printer_entry *print_hnd, PRINTER_INFO_2 *p if ( ntprinter->info_2->secdesc_buf && ntprinter->info_2->secdesc_buf->len != 0 ) { - printer->secdesc = dup_sec_desc( get_talloc_ctx(), ntprinter->info_2->secdesc_buf->sec ); + /* don't use talloc_steal() here unless you do a deep steal of all + the SEC_DESC members */ + + printer->secdesc = dup_sec_desc( get_talloc_ctx(), + ntprinter->info_2->secdesc_buf->sec ); } free_a_printer(&ntprinter, 2); @@ -4205,7 +4209,11 @@ static BOOL construct_printer_info_3(Printer_entry *print_hnd, PRINTER_INFO_3 ** printer->flags = 0x4; if (ntprinter->info_2->secdesc_buf && ntprinter->info_2->secdesc_buf->len != 0) { - printer->secdesc = dup_sec_desc( get_talloc_ctx(), ntprinter->info_2->secdesc_buf->sec ); + /* don't use talloc_steal() here unless you do a deep steal of all + the SEC_DESC members */ + + printer->secdesc = dup_sec_desc( get_talloc_ctx(), + ntprinter->info_2->secdesc_buf->sec ); } free_a_printer(&ntprinter, 2); -- 2.11.4.GIT