summaryrefslogtreecommitdiffstats
path: root/usr.bin/tftp/main.c
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2015-09-22 07:24:31 -0300
committerRenato Botelho <renato@netgate.com>2015-09-22 07:24:31 -0300
commitb5a91a37da44408c68a25426a16a8ca84686f054 (patch)
tree5761589f6059a9c8a3df1d4aed7e7972e6b1c431 /usr.bin/tftp/main.c
parent8400c0790e456038fbca4995d032d4e3d44c3d31 (diff)
parent0f328f755ef12f6cb68a753ed5e48e934002a2b8 (diff)
downloadFreeBSD-src-b5a91a37da44408c68a25426a16a8ca84686f054.zip
FreeBSD-src-b5a91a37da44408c68a25426a16a8ca84686f054.tar.gz
Merge branch 'stable/10' into devel
Diffstat (limited to 'usr.bin/tftp/main.c')
-rw-r--r--usr.bin/tftp/main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/tftp/main.c b/usr.bin/tftp/main.c
index c0f5088..49bd62a 100644
--- a/usr.bin/tftp/main.c
+++ b/usr.bin/tftp/main.c
@@ -223,7 +223,7 @@ urihandling(char *URI)
char line[MAXLINE];
int i;
- strncpy(uri, URI, ARG_MAX);
+ strlcpy(uri, URI, ARG_MAX);
host = uri + 7;
if ((s = strchr(host, '/')) == NULL) {
@@ -320,11 +320,10 @@ setpeer0(char *host, const char *lport)
/* res->ai_addr <= sizeof(peeraddr) is guaranteed */
memcpy(&peer_sock, res->ai_addr, res->ai_addrlen);
if (res->ai_canonname) {
- (void) strncpy(hostname, res->ai_canonname,
+ (void) strlcpy(hostname, res->ai_canonname,
sizeof(hostname));
} else
- (void) strncpy(hostname, host, sizeof(hostname));
- hostname[sizeof(hostname)-1] = 0;
+ (void) strlcpy(hostname, host, sizeof(hostname));
connected = 1;
}
OpenPOWER on IntegriCloud