Skip to content

Commit

Permalink
tools: bpftool: fix argument for p_err() in BTF do_dump()
Browse files Browse the repository at this point in the history
The last argument passed to one call to the p_err() function is not
correct, it should be "*argv" instead of "**argv". This may lead to a
segmentation fault error if BTF id cannot be parsed correctly. Let's fix
this.

Fixes: c93cc69004dt ("bpftool: add ability to dump BTF types")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Quentin Monnet authored and Alexei Starovoitov committed Aug 16, 2019
1 parent 22c349e commit ed4a398
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/btf.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ static int do_dump(int argc, char **argv)

btf_id = strtoul(*argv, &endptr, 0);
if (*endptr) {
p_err("can't parse %s as ID", **argv);
p_err("can't parse %s as ID", *argv);
return -1;
}
NEXT_ARG();
Expand Down

0 comments on commit ed4a398

Please sign in to comment.