summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorKevin Steves <stevesk@cvs.openbsd.org>2001-12-06 18:09:24 +0000
committerKevin Steves <stevesk@cvs.openbsd.org>2001-12-06 18:09:24 +0000
commit9144dd60a4578a7ec78bf1cd5ceb3fb21b2ad34f (patch)
tree8946d1b770f3e3ac888c63d7c0b8f65909367178 /usr.bin
parent66dc933a5f77daef1c9461096eae0357cc77677b (diff)
strncpy->strlcpy. remaining strncpy's are necessary. ok markus@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/channels.c8
-rw-r--r--usr.bin/ssh/session.c5
2 files changed, 5 insertions, 8 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c
index ca840743c9c..6d8abb47203 100644
--- a/usr.bin/ssh/channels.c
+++ b/usr.bin/ssh/channels.c
@@ -39,7 +39,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.144 2001/12/06 18:02:32 stevesk Exp $");
+RCSID("$OpenBSD: channels.c,v 1.145 2001/12/06 18:09:23 stevesk Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -2544,8 +2544,7 @@ x11_connect_display(void)
* Connect to an inet socket. The DISPLAY value is supposedly
* hostname:d[.s], where hostname may also be numeric IP address.
*/
- strncpy(buf, display, sizeof(buf));
- buf[sizeof(buf) - 1] = 0;
+ strlcpy(buf, display, sizeof(buf));
cp = strchr(buf, ':');
if (!cp) {
error("Could not find ':' in DISPLAY: %.100s", display);
@@ -2828,8 +2827,7 @@ auth_input_request_forwarding(struct passwd * pw)
/* Bind it to the name. */
memset(&sunaddr, 0, sizeof(sunaddr));
sunaddr.sun_family = AF_UNIX;
- strncpy(sunaddr.sun_path, auth_sock_name,
- sizeof(sunaddr.sun_path));
+ strlcpy(sunaddr.sun_path, auth_sock_name, sizeof(sunaddr.sun_path));
if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0)
packet_disconnect("bind: %.100s", strerror(errno));
diff --git a/usr.bin/ssh/session.c b/usr.bin/ssh/session.c
index 9296d562e9a..9256f901e9d 100644
--- a/usr.bin/ssh/session.c
+++ b/usr.bin/ssh/session.c
@@ -33,7 +33,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: session.c,v 1.110 2001/12/01 21:41:48 markus Exp $");
+RCSID("$OpenBSD: session.c,v 1.111 2001/12/06 18:09:23 stevesk Exp $");
#include "ssh.h"
#include "ssh1.h"
@@ -1077,8 +1077,7 @@ do_child(Session *s, const char *command)
/* Start the shell. Set initial character to '-'. */
buf[0] = '-';
- strncpy(buf + 1, cp, sizeof(buf) - 1);
- buf[sizeof(buf) - 1] = 0;
+ strlcpy(buf + 1, cp, sizeof(buf) - 1);
/* Execute the shell. */
argv[0] = buf;