diff options
author | Ken Raeburn <raeburn@mit.edu> | 2006-10-14 01:00:40 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2006-10-14 01:00:40 +0000 |
commit | 39534c75341d68f8f571d3045cbadd37669317d1 (patch) | |
tree | 8074ec1a4d1f89278c2d5feb12df986f06d2b9ad /src | |
parent | 7b70e84576a8b2d39fddb57570cd505a433d0e24 (diff) | |
download | krb5-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')
-rw-r--r-- | src/appl/gssftp/ftp/ftp.c | 3 |
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; |