tools: bpftool: fix argument for p_err() in BTF do_dump()
authorQuentin Monnet <quentin.monnet@netronome.com>
Thu, 15 Aug 2019 14:32:17 +0000 (15:32 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 16 Aug 2019 05:06:46 +0000 (22:06 -0700)
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>
tools/bpf/bpftool/btf.c

index 1b8ec91..8805637 100644 (file)
@@ -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();