From 5cb5e0aa9881758ec9f5af7da4fbc002ba91f49b Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Oct 2010 06:07:25 +0200 Subject: s3-spoolss: make sure we dont crash on NULL setprinter level2 elements as seen from win7. Guenther --- source3/rpc_server/srv_spoolss_nt.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'source3') diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 5f803b6304..6b447ad407 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -6127,7 +6127,8 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, printer->drivername)); notify_printer_driver(server_event_context(), msg_ctx, - snum, printer->drivername); + snum, printer->drivername ? + printer->drivername : ""); } } @@ -6145,7 +6146,8 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (!force_update) { notify_printer_comment(server_event_context(), msg_ctx, - snum, printer->comment); + snum, printer->comment ? + printer->comment : ""); } } @@ -6164,7 +6166,8 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (!force_update) { notify_printer_sharename(server_event_context(), msg_ctx, - snum, printer->sharename); + snum, printer->sharename ? + printer->sharename : ""); } } @@ -6191,7 +6194,7 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (!force_update) { notify_printer_printername(server_event_context(), - msg_ctx, snum, p); + msg_ctx, snum, p ? p : ""); } } @@ -6209,7 +6212,8 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (!force_update) { notify_printer_port(server_event_context(), - msg_ctx, snum, printer->portname); + msg_ctx, snum, printer->portname ? + printer->portname : ""); } } @@ -6228,7 +6232,8 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (!force_update) { notify_printer_location(server_event_context(), msg_ctx, snum, - printer->location); + printer->location ? + printer->location : ""); } } @@ -6247,7 +6252,8 @@ static WERROR update_dsspooler(TALLOC_CTX *mem_ctx, if (!force_update) { notify_printer_sepfile(server_event_context(), msg_ctx, snum, - printer->sepfile); + printer->sepfile ? + printer->sepfile : ""); } } -- cgit