]> andersk Git - openssh.git/commitdiff
- stevesk@cvs.openbsd.org 2001/12/06 18:09:23
authormouring <mouring>
Fri, 7 Dec 2001 17:26:48 +0000 (17:26 +0000)
committermouring <mouring>
Fri, 7 Dec 2001 17:26:48 +0000 (17:26 +0000)
     [channels.c session.c]
     strncpy->strlcpy.  remaining strncpy's are necessary.  ok markus@

ChangeLog
channels.c
session.c

index 769d31016d6f9098baa388131bb17ec2bc58a6a8..99e02e94bd7b4ee90195723b98f85cba773582c6 100644 (file)
--- 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
index 7cc0d281e3e1fba733223a9bde6cb5a1385e70ca..3fe619f4803bb32c0c488df3b69e967db2f52c41 100644 (file)
@@ -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));
index 551eb37e6bbc3f1a76fbe39629c2cf31346f1b70..1d7291e6fc889435fe484e61f2d971988bdd679d 100644 (file)
--- 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;
This page took 1.592411 seconds and 5 git commands to generate.