spoolss: fix segfault when "default devmode" is disabled
commit5c6b0500fa8b6273dd735ea8d8a1d8df715cdc89
authorDavid Disseldorp <ddiss@samba.org>
Tue, 27 Nov 2012 15:10:28 +0000 (27 16:10 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 6 Dec 2012 08:40:21 +0000 (6 09:40 +0100)
tree769431b76a92530662e584eefcd60e5fb585de02
parent184ae8079ce7f8ecf3b472f180309e3108897aad
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>
(cherry picked from commit d7fdb05464a67ced7afb8dfdf0aa6be77cb84fd6)
source3/rpc_server/spoolss/srv_spoolss_nt.c