.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * System call table mapper |
---|
3 | 4 | * |
---|
4 | 5 | * (C) 2016 Arnaldo Carvalho de Melo <acme@redhat.com> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or modify it |
---|
7 | | - * under the terms and conditions of the GNU General Public License, |
---|
8 | | - * version 2, as published by the Free Software Foundation. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
11 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
12 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
13 | | - * more details. |
---|
14 | 6 | */ |
---|
15 | 7 | |
---|
16 | 8 | #include "syscalltbl.h" |
---|
17 | 9 | #include <stdlib.h> |
---|
18 | 10 | #include <linux/compiler.h> |
---|
| 11 | +#include <linux/zalloc.h> |
---|
19 | 12 | |
---|
20 | 13 | #ifdef HAVE_SYSCALL_TABLE_SUPPORT |
---|
21 | 14 | #include <string.h> |
---|
22 | 15 | #include "string2.h" |
---|
23 | | -#include "util.h" |
---|
24 | 16 | |
---|
25 | 17 | #if defined(__x86_64__) |
---|
26 | 18 | #include <asm/syscalls_64.c> |
---|
.. | .. |
---|
87 | 79 | |
---|
88 | 80 | qsort(tbl->syscalls.entries, nr_entries, sizeof(struct syscall), syscallcmp); |
---|
89 | 81 | tbl->syscalls.nr_entries = nr_entries; |
---|
| 82 | + tbl->syscalls.max_id = syscalltbl_native_max_id; |
---|
90 | 83 | return 0; |
---|
91 | 84 | } |
---|
92 | 85 | |
---|
.. | .. |
---|
149 | 142 | |
---|
150 | 143 | struct syscalltbl *syscalltbl__new(void) |
---|
151 | 144 | { |
---|
152 | | - struct syscalltbl *tbl = malloc(sizeof(*tbl)); |
---|
| 145 | + struct syscalltbl *tbl = zalloc(sizeof(*tbl)); |
---|
153 | 146 | if (tbl) |
---|
154 | 147 | tbl->audit_machine = audit_detect_machine(); |
---|
155 | 148 | return tbl; |
---|