projects
/
krb5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b70e84
)
Don't strncpy a string to itself
author
Ken Raeburn
<raeburn@mit.edu>
Sat, 14 Oct 2006 01:00:40 +0000
(
01:00
+0000)
committer
Ken Raeburn
<raeburn@mit.edu>
Sat, 14 Oct 2006 01:00:40 +0000
(
01:00
+0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18701
dc483132
-0cff-0310-8789-
dd5450dbe970
src/appl/gssftp/ftp/ftp.c
patch
|
blob
|
history
diff --git
a/src/appl/gssftp/ftp/ftp.c
b/src/appl/gssftp/ftp/ftp.c
index 6ef4e886eba2c909b00f829b8bc44d0af6437306..93ace908871fcadddcf274bd7cb8d57e55446f73 100644
(file)
--- 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;