summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew@openbsd.org>2012-03-02 17:23:08 +0000
committermatthew <matthew@openbsd.org>2012-03-02 17:23:08 +0000
commit1d7edf9348dc78a9dc9f21f82eba047b071d3880 (patch)
tree3c088b7761a72179e75a3109a23d77352e6661fe
parenttweaks; (diff)
downloadwireguard-openbsd-1d7edf9348dc78a9dc9f21f82eba047b071d3880.tar.xz
wireguard-openbsd-1d7edf9348dc78a9dc9f21f82eba047b071d3880.zip
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;