summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/smbd/lanman.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c
index 51472ea309..1e461f10a9 100644
--- a/source3/smbd/lanman.c
+++ b/source3/smbd/lanman.c
@@ -76,7 +76,7 @@ static int CopyExpanded(connection_struct *conn,
StrnCpy(buf,src,sizeof(buf)/2);
pstring_sub(buf,"%S",lp_servicename(snum));
standard_sub_conn(conn,buf);
- StrnCpy(*dst,buf,*n);
+ StrnCpy(*dst,buf,*n-1);
l = strlen(*dst) + 1;
(*dst) += l;
(*n) -= l;