summaryrefslogtreecommitdiff
path: root/scp.c
diff options
context:
space:
mode:
Diffstat (limited to 'scp.c')
-rw-r--r--scp.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/scp.c b/scp.c
index e603646b6..b5cb541b4 100644
--- a/scp.c
+++ b/scp.c
@@ -75,7 +75,7 @@
75 */ 75 */
76 76
77#include "includes.h" 77#include "includes.h"
78RCSID("$OpenBSD: scp.c,v 1.84 2001/09/19 19:24:19 stevesk Exp $"); 78RCSID("$OpenBSD: scp.c,v 1.85 2001/10/01 08:06:28 markus Exp $");
79 79
80#include "xmalloc.h" 80#include "xmalloc.h"
81#include "atomicio.h" 81#include "atomicio.h"
@@ -503,6 +503,11 @@ source(argc, argv)
503 len = strlen(name); 503 len = strlen(name);
504 while (len > 1 && name[len-1] == '/') 504 while (len > 1 && name[len-1] == '/')
505 name[--len] = '\0'; 505 name[--len] = '\0';
506 if (strchr(name, '\n') != NULL) {
507 run_err("%s: skipping, filename contains a newline",
508 name);
509 goto next;
510 }
506 if ((fd = open(name, O_RDONLY, 0)) < 0) 511 if ((fd = open(name, O_RDONLY, 0)) < 0)
507 goto syserr; 512 goto syserr;
508 if (fstat(fd, &stb) < 0) { 513 if (fstat(fd, &stb) < 0) {