From 611b1987434579a843bc7b64c2fa04b60115cbbc Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Mon, 20 Oct 2003 14:02:02 +0000 Subject: make sure we have a devmode before copying a string to the devicename; patch from metze (This used to be commit 1700e83ac8035db7d22b8c64c10f63cb3e3b9eb7) --- source3/printing/nt_printing.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 9c95cf9085..5b5b5885ab 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -3306,10 +3306,11 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, const char *sh printername)); info.devmode = construct_nt_devicemode(printername); } - - safe_strcpy(adevice, info.printername, sizeof(adevice)-1); - fstrcpy(info.devmode->devicename, adevice); + safe_strcpy(adevice, info.printername, sizeof(adevice)-1); + if (info.devmode) { + fstrcpy(info.devmode->devicename, adevice); + } len += unpack_values( &info.data, dbuf.dptr+len, dbuf.dsize-len ); -- cgit