1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00

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

This commit is contained in:
Gerald Carter 0001-01-01 00:00:00 +00:00
parent c8ec714119
commit 5479cb60c0

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