summaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/main.h
diff options
context:
space:
mode:
authorQuentin Monnet <quentin.monnet@netronome.com>2017-11-28 17:44:28 -0800
committerDaniel Borkmann <daniel@iogearbox.net>2017-11-30 02:09:29 +0100
commit9b85c2d4508563f4bb1de0d971ed02fea0d0d757 (patch)
treee9d2683c58114c5b9c78a058d881c117bf1fd75d /tools/bpf/bpftool/main.h
parenta39e17b2d842938e19997d2fdc0443fdd4cd8d10 (diff)
downloadlinux-9b85c2d4508563f4bb1de0d971ed02fea0d0d757.tar.bz2
tools: bpftool: fix crash on bad parameters with JSON
If bad or unrecognised parameters are specified after JSON output is requested, `usage()` will try to output null JSON object before the writer is created. To prevent this, create the writer as soon as the `--json` option is parsed. Fixes: 004b45c0e51a ("tools: bpftool: provide JSON output for all possible commands") Reported-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'tools/bpf/bpftool/main.h')
0 files changed, 0 insertions, 0 deletions