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 | 6c43327ea2b50820ea4f623c889dc4525d58baa3 (patch) | |
tree | fcb9b06cc7f543bcf43792902c79f3138f82c2f0 /source | |
parent | bd0c84d60b703e89081838a7cfa1eb1b4f45ad0a (diff) | |
download | samba-6c43327ea2b50820ea4f623c889dc4525d58baa3.tar.gz samba-6c43327ea2b50820ea4f623c889dc4525d58baa3.tar.xz samba-6c43327ea2b50820ea4f623c889dc4525d58baa3.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
Diffstat (limited to 'source')
-rw-r--r-- | source/printing/nt_printing.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c index 0f5067c5a08..4c454ef111b 100644 --- a/source/printing/nt_printing.c +++ b/source/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"); |