summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-15 13:18:42 -0800
committerJeremy Allison <jra@samba.org>2007-11-15 13:18:42 -0800
commit8e1b0f81c27dc332560f19de27fb86ac96c59775 (patch)
tree15ff35483e788fe702b93896938095e202efef6e
parentd41713b10770765cd0b30f8b5c8d6bddad4de2d6 (diff)
downloadsamba-8e1b0f81c27dc332560f19de27fb86ac96c59775.tar.gz
samba-8e1b0f81c27dc332560f19de27fb86ac96c59775.tar.bz2
samba-8e1b0f81c27dc332560f19de27fb86ac96c59775.zip
alpha_strcpy includes the space for the terminating nul.
Jeremy. (This used to be commit b3ed3f7e4e40c4f78d4c347411c75de81979455f)
-rw-r--r--source3/lib/substitute.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/lib/substitute.c b/source3/lib/substitute.c
index ce88a78e77..db79a9f2b5 100644
--- a/source3/lib/substitute.c
+++ b/source3/lib/substitute.c
@@ -72,8 +72,9 @@ bool set_local_machine_name(const char *local_name, bool perm)
SAFE_FREE(tmp_local_machine);
return false;
}
+ /* alpha_strcpy includes the space for the terminating nul. */
alpha_strcpy(local_machine,tmp_local_machine,
- SAFE_NETBIOS_CHARS,len);
+ SAFE_NETBIOS_CHARS,len+1);
strlower_m(local_machine);
SAFE_FREE(tmp_local_machine);
@@ -123,8 +124,9 @@ bool set_remote_machine_name(const char *remote_name, bool perm)
return false;
}
+ /* alpha_strcpy includes the space for the terminating nul. */
alpha_strcpy(remote_machine,tmp_remote_machine,
- SAFE_NETBIOS_CHARS,len);
+ SAFE_NETBIOS_CHARS,len+1);
strlower_m(remote_machine);
SAFE_FREE(tmp_remote_machine);
@@ -185,9 +187,10 @@ void sub_set_smb_name(const char *name)
return;
}
+ /* alpha_strcpy includes the space for the terminating nul. */
alpha_strcpy(smb_user_name, tmp,
SAFE_NETBIOS_CHARS,
- len);
+ len+1);
SAFE_FREE(tmp);