summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2003-10-20 14:02:58 +0000
committerGerald Carter <jerry@samba.org>2003-10-20 14:02:58 +0000
commit1db4a703a8aa1caf53da68a9dd085b6ff0a25505 (patch)
tree38031f81c108db5c0e3ca888de0eb0aefc4946a9 /source3/printing
parent2f643426731f473b7f77efa95c4898ca2233ccc1 (diff)
downloadsamba-1db4a703a8aa1caf53da68a9dd085b6ff0a25505.tar.gz
samba-1db4a703a8aa1caf53da68a9dd085b6ff0a25505.tar.bz2
samba-1db4a703a8aa1caf53da68a9dd085b6ff0a25505.zip
make sure we have a devmode before copying a string to the devicename; patch from metze
(This used to be commit 5479cb60c038969270353b9ff7a8e9967e066dfd)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c7
1 files changed, 4 insertions, 3 deletions
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 );