summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--sftp-int.c11
2 files changed, 10 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index a06e8d880..18256d037 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@
15 - markus@cvs.openbsd.org 2001/03/16 09:55:53 15 - markus@cvs.openbsd.org 2001/03/16 09:55:53
16 [sftp-int.c] 16 [sftp-int.c]
17 fix memset and whitespace 17 fix memset and whitespace
18 - markus@cvs.openbsd.org 2001/03/16 13:44:24
19 [sftp-int.c]
20 discourage strcat/strcpy
18 21
1920010315 2220010315
20 - OpenBSD CVS Sync 23 - OpenBSD CVS Sync
@@ -4577,4 +4580,4 @@
4577 - Wrote replacements for strlcpy and mkdtemp 4580 - Wrote replacements for strlcpy and mkdtemp
4578 - Released 1.0pre1 4581 - Released 1.0pre1
4579 4582
4580$Id: ChangeLog,v 1.965 2001/03/17 00:36:17 mouring Exp $ 4583$Id: ChangeLog,v 1.966 2001/03/17 00:37:31 mouring Exp $
diff --git a/sftp-int.c b/sftp-int.c
index f77e2ebd9..8e45f869b 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -26,7 +26,7 @@
26/* XXX: recursive operations */ 26/* XXX: recursive operations */
27 27
28#include "includes.h" 28#include "includes.h"
29RCSID("$OpenBSD: sftp-int.c,v 1.30 2001/03/16 09:55:53 markus Exp $"); 29RCSID("$OpenBSD: sftp-int.c,v 1.31 2001/03/16 13:44:24 markus Exp $");
30 30
31#include "buffer.h" 31#include "buffer.h"
32#include "xmalloc.h" 32#include "xmalloc.h"
@@ -198,11 +198,12 @@ char *
198path_append(char *p1, char *p2) 198path_append(char *p1, char *p2)
199{ 199{
200 char *ret; 200 char *ret;
201 int len = strlen(p1) + strlen(p2) + 2;
201 202
202 ret = xmalloc(strlen(p1) + strlen(p2) + 2); 203 ret = xmalloc(len);
203 strcpy(ret, p1); 204 strlcpy(ret, p1, len);
204 strcat(ret, "/"); 205 strlcat(ret, "/", len);
205 strcat(ret, p2); 206 strlcat(ret, p2, len);
206 207
207 return(ret); 208 return(ret);
208} 209}