spoolss: fix segfault when "default devmode" is disabled
commit2e12deedcfdc5ce3637a125b083b0f00b208bf61
authorDavid Disseldorp <ddiss@samba.org>
Tue, 27 Nov 2012 15:10:28 +0000 (27 16:10 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 29 Nov 2012 12:03:05 +0000 (29 13:03 +0100)
treebe8e6e8c7a7a861ee0e06d176967f250b5c30672
parent941bb9bb6dfd1c2dfd01696b2169e0782158ad6d
spoolss: fix segfault when "default devmode" is disabled

Currently when "default devmode" is explicitly disabled, and a printer
is added with a null device mode, spoolssd crashes in copy_devicemode().

Both construct_printer_info2() and construct_printer_info8() code paths
currently unconditionally attempt to copy a printers device mode,
without checking whether one is present.

This change fixes this regression such that construct_printer_info*()
functions check for a null device mode before copying.

https://bugzilla.samba.org/show_bug.cgi?id=9433

Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Nov 29 13:03:05 CET 2012 on sn-devel-104
source3/rpc_server/spoolss/srv_spoolss_nt.c