summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-12-07 17:26:48 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-12-07 17:26:48 +0000
commitccd8d07b3cf35190b5fdbd8597e908c05e3e15b7 (patch)
tree50ab332b6ffd3a38a2a01100b31f3ad899740fb4
parente181a4d2949d063a9417cf2691cb0ec2d3568e53 (diff)
- stevesk@cvs.openbsd.org 2001/12/06 18:09:23
[channels.c session.c] strncpy->strlcpy. remaining strncpy's are necessary. ok markus@
-rw-r--r--ChangeLog5
-rw-r--r--channels.c8
-rw-r--r--session.c5
3 files changed, 9 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index f589a537..d7945707 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@
- stevesk@cvs.openbsd.org 2001/12/06 18:02:32
[channels.c sshconnect.c]
shutdown(sock, SHUT_RDWR) not needed here; ok markus@
+ - stevesk@cvs.openbsd.org 2001/12/06 18:09:23
+ [channels.c session.c]
+ strncpy->strlcpy. remaining strncpy's are necessary. ok markus@
20011206
- (bal) OpenBSD CVS Sync
@@ -7002,4 +7005,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.1689 2001/12/07 17:24:49 mouring Exp $
+$Id: ChangeLog,v 1.1690 2001/12/07 17:26:48 mouring Exp $
diff --git a/channels.c b/channels.c
index 7cc0d281..3fe619f4 100644
--- a/channels.c
+++ b/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"
@@ -2609,8 +2609,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);
@@ -2893,8 +2892,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/session.c b/session.c
index 551eb37e..1d7291e6 100644
--- a/session.c
+++ b/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"
@@ -1473,8 +1473,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;