summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-03-14 02:10:26 +0000
committerJeremy Allison <jra@samba.org>2003-03-14 02:10:26 +0000
commita3d7a1ea200a84aea77b67f9ed1cb6c4ae48442f (patch)
tree2eba33ab238eb9eb4d82dc29b65ad36bcc5f38ef /source3/printing
parentd06a057e6faf0e46f2d76a44244dcbcbbd25c891 (diff)
downloadsamba-a3d7a1ea200a84aea77b67f9ed1cb6c4ae48442f.tar.gz
samba-a3d7a1ea200a84aea77b67f9ed1cb6c4ae48442f.tar.bz2
samba-a3d7a1ea200a84aea77b67f9ed1cb6c4ae48442f.zip
Fix off by one bug noticed by Andrew Bartlett.
Jeremy. (This used to be commit 759aab9944e8dc5c38e224ace738b75ded07ee54)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 74a9ac8174..3f5bf55534 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2110,7 +2110,7 @@ done:
NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
{
- char adevice[MAXDEVICENAME];
+ char adevice[MAXDEVICENAME+1];
NT_DEVICEMODE *nt_devmode = (NT_DEVICEMODE *)malloc(sizeof(NT_DEVICEMODE));
if (nt_devmode == NULL) {
@@ -2120,7 +2120,7 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
ZERO_STRUCTP(nt_devmode);
- safe_strcpy(adevice, default_devicename, sizeof(adevice));
+ safe_strcpy(adevice, default_devicename, sizeof(adevice)-1);
fstrcpy(nt_devmode->devicename, adevice);
fstrcpy(nt_devmode->formname, "Letter");