diff options
author | Andrew Bartlett <abartlet@samba.org> | 2003-03-04 09:33:34 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2003-03-04 09:33:34 +0000 |
commit | c502756113d53c7000c0f83a109ac36cb3a1020b (patch) | |
tree | a6740df5849211524c26a74634b93de8741f28db /source3/printing/nt_printing.c | |
parent | 7f15d5828f6683f2490ef864a2176919549880d7 (diff) | |
download | samba-c502756113d53c7000c0f83a109ac36cb3a1020b.tar.gz samba-c502756113d53c7000c0f83a109ac36cb3a1020b.tar.bz2 samba-c502756113d53c7000c0f83a109ac36cb3a1020b.zip |
Fix another 'off by one' bug with safe_strcpy(). It is unclear if the intent
was to limit the string to 31 or 32 characters (excluding the null term), so
I've assumed for now that 32 is fine, as this matches current behaviour (well, current behaviour would crash, but anyway...)
Jerry: Can you look at this for me?
Andrew Bartlett
(This used to be commit 6c43327ea2b50820ea4f623c889dc4525d58baa3)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 0f5067c5a0..4c454ef111 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2106,7 +2106,7 @@ done: NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename) { - char adevice[32]; + char adevice[33]; NT_DEVICEMODE *nt_devmode = (NT_DEVICEMODE *)malloc(sizeof(NT_DEVICEMODE)); if (nt_devmode == NULL) { @@ -2116,7 +2116,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"); |