aboutsummaryrefslogtreecommitdiff
path: root/src/appl
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2006-10-14 01:00:40 +0000
committerKen Raeburn <raeburn@mit.edu>2006-10-14 01:00:40 +0000
commit39534c75341d68f8f571d3045cbadd37669317d1 (patch)
tree8074ec1a4d1f89278c2d5feb12df986f06d2b9ad /src/appl
parent7b70e84576a8b2d39fddb57570cd505a433d0e24 (diff)
downloadkrb5-39534c75341d68f8f571d3045cbadd37669317d1.zip
krb5-39534c75341d68f8f571d3045cbadd37669317d1.tar.gz
krb5-39534c75341d68f8f571d3045cbadd37669317d1.tar.bz2
Don't strncpy a string to itself
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18701 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/appl')
-rw-r--r--src/appl/gssftp/ftp/ftp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/appl/gssftp/ftp/ftp.c b/src/appl/gssftp/ftp/ftp.c
index 6ef4e88..93ace90 100644
--- a/src/appl/gssftp/ftp/ftp.c
+++ b/src/appl/gssftp/ftp/ftp.c
@@ -1684,7 +1684,8 @@ void pswitch(int flag)
ip->connect = connected;
connected = op->connect;
if (hostname) {
- (void) strncpy(ip->name, hostname, sizeof(ip->name) - 1);
+ if (ip->name != hostname)
+ (void) strncpy(ip->name, hostname, sizeof(ip->name) - 1);
ip->name[strlen(ip->name)] = '\0';
} else
ip->name[0] = 0;