summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2002-08-01 20:50:18 +0000
committerNiels Provos <provos@cvs.openbsd.org>2002-08-01 20:50:18 +0000
commitebf497d42a749a3e753c69f1499451149aed102c (patch)
tree85726a63c0f584c211236157ebd77aadb85e14d5 /bin
parent380248e55b12f89a504df72070d12c61bd7f691c (diff)
correctly separate execve argv arguments. increase buffer size for
get_string
Diffstat (limited to 'bin')
-rw-r--r--bin/systrace/intercept.c5
-rw-r--r--bin/systrace/systrace-translate.c4
2 files changed, 6 insertions, 3 deletions
diff --git a/bin/systrace/intercept.c b/bin/systrace/intercept.c
index 453d0d46cc1..6208d87be70 100644
--- a/bin/systrace/intercept.c
+++ b/bin/systrace/intercept.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intercept.c,v 1.21 2002/08/01 20:16:45 provos Exp $ */
+/* $OpenBSD: intercept.c,v 1.22 2002/08/01 20:50:17 provos Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -34,6 +34,7 @@
#include <sys/tree.h>
#include <sys/wait.h>
#include <sys/stat.h>
+#include <limits.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
@@ -485,7 +486,7 @@ intercept_replace(int fd, pid_t pid, struct intercept_replace *repl)
char *
intercept_get_string(int fd, pid_t pid, void *addr)
{
- static char name[MAXPATHLEN];
+ static char name[_POSIX2_LINE_MAX];
int off = 0, done = 0;
do {
diff --git a/bin/systrace/systrace-translate.c b/bin/systrace/systrace-translate.c
index cd55acd8c3e..0d8fa961d77 100644
--- a/bin/systrace/systrace-translate.c
+++ b/bin/systrace/systrace-translate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: systrace-translate.c,v 1.9 2002/07/30 06:07:06 itojun Exp $ */
+/* $OpenBSD: systrace-translate.c,v 1.10 2002/08/01 20:50:17 provos Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -190,6 +190,7 @@ get_argv(struct intercept_translate *trans, int fd, pid_t pid, void *addr)
int i, off = 0, len;
extern struct intercept_system intercept;
+ i = 0;
buf[0] = '\0';
while (1) {
if (intercept.io(fd, pid, INTERCEPT_READ, (char *)addr + off,
@@ -209,6 +210,7 @@ get_argv(struct intercept_translate *trans, int fd, pid_t pid, void *addr)
strlcat(buf, p, sizeof(buf));
off += sizeof(char *);
+ i++;
}
len = strlen(buf) + 1;