summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2019-11-06 22:28:05 -0500
committerPaul Moore <paul@paul-moore.com>2019-11-06 22:44:09 -0500
commit1b6cfd1fc0b7499a28c24299a93a80bd18619563 (patch)
tree0e17a17d1931001f11632cecea5b1571f46e133f
parentc0f32c6ffc9c05fd7c2331d5aee15a5f1e4c315f (diff)
downloadlibseccomp-1b6cfd1fc0b7499a28c24299a93a80bd18619563.tar.gz
tools: ensure a bpf file is specified on the command linev2.4.2
(imported from commit 94d42926fd67d2d4fa07031bdc6c6bf8e420a103) Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r--tools/scmp_bpf_sim.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c
index 73d056b..1408717 100644
--- a/tools/scmp_bpf_sim.c
+++ b/tools/scmp_bpf_sim.c
@@ -340,6 +340,8 @@ int main(int argc, char *argv[])
exit_fault(ENOMEM);
/* load the bpf program */
+ if (opt_file == NULL)
+ exit_usage(argv[0]);
file = fopen(opt_file, "r");
if (file == NULL)
exit_fault(errno);