summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2012-03-02 17:23:09 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2012-03-02 17:23:09 +0000
commitef35a6dd98a064c1c27f076bf147ac89bb4b11ec (patch)
tree5fa3882ca8f2dc5473cd28df6dd484364f9347c0
parentaf83dfb75b559e76ee0a5ea94c4337fe7ab1a585 (diff)
Fix handling of 'offend' (OFFset from the END of the arg list)
arguments in systrace(1). In intercept_translate(), argsize is actually the number of *bytes* taken up by the arguments, not the number of arguments. ok ajacoutot, sthen, dcoppa
-rw-r--r--bin/systrace/intercept-translate.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/systrace/intercept-translate.c b/bin/systrace/intercept-translate.c
index 0a0b12ec522..6f6d8ad9ae5 100644
--- a/bin/systrace/intercept-translate.c
+++ b/bin/systrace/intercept-translate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intercept-translate.c,v 1.14 2011/09/18 23:24:14 matthew Exp $ */
+/* $OpenBSD: intercept-translate.c,v 1.15 2012/03/02 17:23:08 matthew Exp $ */
/*
* Copyright 2002 Niels Provos <provos@citi.umich.edu>
* All rights reserved.
@@ -89,7 +89,10 @@ intercept_translate(struct intercept_translate *trans,
trans->trans_addr2 = addr2;
}
if (trans->offend) {
- if (intercept.getarg(argsize + trans->offend,
+ /* XXX: Abstraction violation. */
+ int numargs = argsize / sizeof(register_t);
+
+ if (intercept.getarg(numargs + trans->offend,
args, argsize, &addrend) == -1)
return (-1);
trans->trans_addrend = addrend;