diff options
-rw-r--r-- | src/python/seccomp.pyx | 4 | ||||
-rw-r--r-- | tests/11-basic-basic_errors.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx index 73f6625..e2f9f2a 100644 --- a/src/python/seccomp.pyx +++ b/src/python/seccomp.pyx @@ -1061,8 +1061,8 @@ cdef class SyscallFilter: raise RuntimeError(str.format("Library error (errno = {0})", rc)) # Get the program. - cdef array.array data = array.array('b', bytes(len)) - cdef char[:] program = data + cdef array.array data = array.array('B', bytes(len)) + cdef unsigned char[:] program = data rc = libseccomp.seccomp_export_bpf_mem(self._ctx, <void *>&program[0], <size_t *>&len) if rc != 0: diff --git a/tests/11-basic-basic_errors.c b/tests/11-basic-basic_errors.c index 53fe95d..785e094 100644 --- a/tests/11-basic-basic_errors.c +++ b/tests/11-basic-basic_errors.c @@ -192,9 +192,11 @@ int main(int argc, char *argv[]) if (rc != -EINVAL) return -1; + buf_len = sizeof(buf); rc = seccomp_export_bpf_mem(ctx, NULL, &buf_len); if (rc != 0) return -1; + buf_len = sizeof(buf); rc = seccomp_export_bpf_mem(ctx, buf, &buf_len); if (rc != 0) return -1; |