1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

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

(This used to be commit 21ec2b6ba3ddba6964f6ddb53f8494e4a8b48a83)
This commit is contained in:
Gerald Carter 2003-03-06 16:06:12 +00:00
parent ca0d82b11c
commit 26b1ed7cc0
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[33];
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))