diff options
author | 2018-09-04 08:28:14 -0400 | |
---|---|---|
committer | 2018-09-04 08:28:14 -0400 | |
commit | e8989dc95bc55644661ded3c2b68212e296d19bd (patch) | |
tree | 7ecdf9603d4bd354902db65d8bd7ca944f993447 /src/libpostexecseccomp | |
parent | mainline merges (diff) | |
download | firejail-e8989dc95bc55644661ded3c2b68212e296d19bd.tar.gz firejail-e8989dc95bc55644661ded3c2b68212e296d19bd.tar.zst firejail-e8989dc95bc55644661ded3c2b68212e296d19bd.zip |
mainline merge
Diffstat (limited to 'src/libpostexecseccomp')
-rw-r--r-- | src/libpostexecseccomp/libpostexecseccomp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libpostexecseccomp/libpostexecseccomp.c b/src/libpostexecseccomp/libpostexecseccomp.c index 0ccb74b10..de64d50c5 100644 --- a/src/libpostexecseccomp/libpostexecseccomp.c +++ b/src/libpostexecseccomp/libpostexecseccomp.c | |||
@@ -31,7 +31,9 @@ static void load_seccomp(void) { | |||
31 | if (fd == -1) | 31 | if (fd == -1) |
32 | return; | 32 | return; |
33 | 33 | ||
34 | int size = lseek(fd, 0, SEEK_END); | 34 | off_t size = lseek(fd, 0, SEEK_END); |
35 | if (size <= 0) | ||
36 | return; | ||
35 | unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter); | 37 | unsigned short entries = (unsigned short) size / (unsigned short) sizeof(struct sock_filter); |
36 | struct sock_filter *filter = MAP_FAILED; | 38 | struct sock_filter *filter = MAP_FAILED; |
37 | if (size != 0) | 39 | if (size != 0) |
@@ -39,7 +41,7 @@ static void load_seccomp(void) { | |||
39 | 41 | ||
40 | close(fd); | 42 | close(fd); |
41 | 43 | ||
42 | if (size == 0 || filter == MAP_FAILED) | 44 | if (filter == MAP_FAILED) |
43 | return; | 45 | return; |
44 | 46 | ||
45 | // install filter | 47 | // install filter |