From 1b6cfd1fc0b7499a28c24299a93a80bd18619563 Mon Sep 17 00:00:00 2001 From: Paul Moore Date: Wed, 6 Nov 2019 22:28:05 -0500 Subject: [PATCH] tools: ensure a bpf file is specified on the command line (imported from commit 94d42926fd67d2d4fa07031bdc6c6bf8e420a103) Signed-off-by: Paul Moore --- tools/scmp_bpf_sim.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/scmp_bpf_sim.c b/tools/scmp_bpf_sim.c index 73d056b1..14087178 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);