1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

make sure we have a devmode before copying a string to the devicename; patch from metze

(This used to be commit 5479cb60c0)
This commit is contained in:
Gerald Carter 2003-10-20 14:02:58 +00:00
parent 2f64342673
commit 1db4a703a8

View File

@ -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 );