spoolss: fix segfault when "default devmode" is disabled
authorDavid Disseldorp <ddiss@samba.org>
Tue, 27 Nov 2012 15:10:28 +0000 (16:10 +0100)
committerKarolin Seeger <kseeger@samba.org>
Fri, 30 Nov 2012 08:16:10 +0000 (09:16 +0100)
commit5a5894c05c07fd1b98d5346085c762642b471d58
tree7a5d2178054d482dc825c3d7f6f7a62eb89392f9
parent0fa3d75268b402d05bc23f950888f529e84ea5f4
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
(cherry picked from commit 2e12deedcfdc5ce3637a125b083b0f00b208bf61)
source3/rpc_server/spoolss/srv_spoolss_nt.c