aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-04-12 14:40:55 +0200
committerAlice Frosi <afrosi@redhat.com>2023-04-12 14:40:55 +0200
commit917ca7a3bb60c6d992fb04ece1163870d16f3fce (patch)
treebca797e1fe99f8854d83c9c413ef483fe65496d1
parent8717257069249cdb217575bb3a3512d35bfadafb (diff)
downloadseitan-917ca7a3bb60c6d992fb04ece1163870d16f3fce.tar
seitan-917ca7a3bb60c6d992fb04ece1163870d16f3fce.tar.gz
seitan-917ca7a3bb60c6d992fb04ece1163870d16f3fce.tar.bz2
seitan-917ca7a3bb60c6d992fb04ece1163870d16f3fce.tar.lz
seitan-917ca7a3bb60c6d992fb04ece1163870d16f3fce.tar.xz
seitan-917ca7a3bb60c6d992fb04ece1163870d16f3fce.tar.zst
seitan-917ca7a3bb60c6d992fb04ece1163870d16f3fce.zip
Fix offset after refactoring
-rw-r--r--cooker/filter.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cooker/filter.c b/cooker/filter.c
index a46e8ce..0b35463 100644
--- a/cooker/filter.c
+++ b/cooker/filter.c
@@ -371,6 +371,8 @@ unsigned int create_bfp_program(struct syscall_entry table[],
unsigned int notify, accept;
unsigned int i, j, k, size;
unsigned int next_offset, offset;
+ unsigned int next_args_off;
+ unsigned n_checks;
int nodes[MAX_JUMPS];
create_lookup_nodes(nodes, n_syscall);
@@ -433,9 +435,11 @@ unsigned int create_bfp_program(struct syscall_entry table[],
for (i = 0; i < n_syscall; i++) {
bool has_arg = false;
for (j = 0; j < (table[i]).count; j++) {
- unsigned n_checks = 0;
+ n_checks = 0;
entry = table[i].entry + j;
+ next_args_off = get_n_args_syscall_entry(entry);
for (k = 0; k < 6; k++) {
+ offset = next_args_off - n_checks;
switch (entry->args[k].cmp) {
case NO_CHECK:
continue;