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

add #define for the max device name length in a DEVICEMODE

This commit is contained in:
Gerald Carter 0001-01-01 00:00:00 +00:00
parent 214decbda6
commit 52ef84b534
3 changed files with 4 additions and 2 deletions

View File

@ -255,6 +255,8 @@ typedef struct {
NT_PRINTER_KEY *keys;
} NT_PRINTER_DATA;
#define MAXDEVICENAME 32
typedef struct ntdevicemode
{
fstring devicename;

View File

@ -2110,7 +2110,7 @@ done:
NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
{
char adevice[32];
char adevice[MAXDEVICENAME];
NT_DEVICEMODE *nt_devmode = (NT_DEVICEMODE *)malloc(sizeof(NT_DEVICEMODE));
if (nt_devmode == NULL) {

View File

@ -684,7 +684,7 @@ BOOL spoolss_io_devmode(const char *desc, prs_struct *ps, int depth, DEVICEMODE
return False;
}
if (!prs_uint16uni(True,"devicename", ps, depth, devmode->devicename.buffer, 32))
if (!prs_uint16uni(True,"devicename", ps, depth, devmode->devicename.buffer, MAXDEVICENAME))
return False;
if (!prs_uint16("specversion", ps, depth, &devmode->specversion))