diff options
Diffstat (limited to 'src/libpostexecseccomp')
-rw-r--r-- | src/libpostexecseccomp/libpostexecseccomp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libpostexecseccomp/libpostexecseccomp.c b/src/libpostexecseccomp/libpostexecseccomp.c index 6d2c8c695..de64d50c5 100644 --- a/src/libpostexecseccomp/libpostexecseccomp.c +++ b/src/libpostexecseccomp/libpostexecseccomp.c | |||
@@ -32,6 +32,8 @@ static void load_seccomp(void) { | |||
32 | return; | 32 | return; |
33 | 33 | ||
34 | off_t 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 |