]> andersk Git - openssh.git/commitdiff
- deraadt@cvs.openbsd.org 2005/03/31 18:39:21
authordjm <djm>
Sun, 3 Apr 2005 00:16:11 +0000 (00:16 +0000)
committerdjm <djm>
Sun, 3 Apr 2005 00:16:11 +0000 (00:16 +0000)
     [scp.c]
     copy argv[] element instead of smashing the one that ps will see; ok otto

ChangeLog
scp.c

index 64273f089713ce2f52020cd3e19fe86e822418aa..f988cd8f1035cc17cd7d7eafcf48554c336e0d2c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+20050403
+ - (djm) OpenBSD CVS Sync
+   - deraadt@cvs.openbsd.org 2005/03/31 18:39:21
+     [scp.c]
+     copy argv[] element instead of smashing the one that ps will see; ok otto
+
 20050331
  - (dtucker) OpenBSD CVS Sync
    - jmc@cvs.openbsd.org 2005/03/16 11:10:38
diff --git a/scp.c b/scp.c
index f69fd05fc66ff418a43f30d366ff7d84ca178b1e..dcea1946bde2b75b49c7dfd88e3eb3a20165d582 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -71,7 +71,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $");
+RCSID("$OpenBSD: scp.c,v 1.120 2005/03/31 18:39:21 deraadt Exp $");
 
 #include "xmalloc.h"
 #include "atomicio.h"
@@ -361,20 +361,23 @@ void
 toremote(char *targ, int argc, char **argv)
 {
        int i, len;
-       char *bp, *host, *src, *suser, *thost, *tuser;
+       char *bp, *host, *src, *suser, *thost, *tuser, *arg;
 
        *targ++ = 0;
        if (*targ == 0)
                targ = ".";
 
-       if ((thost = strrchr(argv[argc - 1], '@'))) {
+       arg = strdup(argv[argc - 1]);
+       if (!arg)
+               err(1, "malloc");
+       if ((thost = strrchr(arg, '@'))) {
                /* user@host */
                *thost++ = 0;
-               tuser = argv[argc - 1];
+               tuser = arg;
                if (*tuser == '\0')
                        tuser = NULL;
        } else {
-               thost = argv[argc - 1];
+               thost = arg;
                tuser = NULL;
        }
 
This page took 0.17376 seconds and 5 git commands to generate.