Created attachment 15131 [details] ASAN error report ==27165==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffc12312b10 at pc 0x7f5f2219512b bp 0x7ffc123126e0 sp 0x7ffc123126d0 READ of size 4 at 0x7ffc12312b10 thread T0 #0 0x7f5f2219512a in ndr_push_spoolss_SetPrinterInfo8 librpc/gen_ndr/ndr_spoolss.c:8466 #1 0x7f5f2219512a in ndr_push_spoolss_SetPrinterInfo librpc/gen_ndr/ndr_spoolss.c:8639 #2 0x7f5f221c782a in ndr_push_spoolss_SetPrinterInfoCtr librpc/gen_ndr/ndr_spoolss.c:9002 To reproduce: * configure with --address-sanitizer enabled * make TESTS="samba3.rpc.spoolss.printer"
The info and info8 variables in the torture suite need to be in the calling scope, not in the switch. switch (level) { case 2: { union spoolss_PrinterInfo info; torture_assert(tctx, test_GetPrinter_level(tctx, b, handle, 2, &info), ""); torture_assert(tctx, PrinterInfo_to_SetPrinterInfo(tctx, &info, 2, &sinfo), ""); info_ctr.level = 2; info_ctr.info = sinfo; break; } case 8: { struct spoolss_SetPrinterInfo8 info8; info8.devmode_ptr = 0; info_ctr.level = 8; info_ctr.info.info8 = &info8; break; } Torture code only, not security relevant.
closing as wontfix accordingly