Skip to content

Commit 1b6cfd1

Browse files
committed
tools: ensure a bpf file is specified on the command line
(imported from commit 94d4292) Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent c0f32c6 commit 1b6cfd1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tools/scmp_bpf_sim.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ int main(int argc, char *argv[])
340340
exit_fault(ENOMEM);
341341

342342
/* load the bpf program */
343+
if (opt_file == NULL)
344+
exit_usage(argv[0]);
343345
file = fopen(opt_file, "r");
344346
if (file == NULL)
345347
exit_fault(errno);

0 commit comments

Comments
 (0)