From 8e1b0f81c27dc332560f19de27fb86ac96c59775 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 15 Nov 2007 13:18:42 -0800 Subject: alpha_strcpy includes the space for the terminating nul. Jeremy. (This used to be commit b3ed3f7e4e40c4f78d4c347411c75de81979455f) --- source3/lib/substitute.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3/lib') 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); -- cgit