diff options
author | Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> | 2017-11-02 11:09:45 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-11-02 14:25:27 +0300 |
commit | cdc89c91987bd6efa962b36d4ea86d0c9152eb11 (patch) | |
tree | cfd5468c873c69a8d17cdad31e249638756a80cd /tools/bpf/bpf_jit_disasm.c | |
parent | e20f469660ad526fcd9bf865e30ee491ae4e4a86 (diff) | |
download | linux-cdc89c91987bd6efa962b36d4ea86d0c9152eb11.tar.xz |
tools: bpf: handle long path in jit disasm
Use PATH_MAX instead of hardcoded array size 256
Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/bpf/bpf_jit_disasm.c')
-rw-r--r-- | tools/bpf/bpf_jit_disasm.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/bpf/bpf_jit_disasm.c b/tools/bpf/bpf_jit_disasm.c index 422d9abd666a..75bf526a0168 100644 --- a/tools/bpf/bpf_jit_disasm.c +++ b/tools/bpf/bpf_jit_disasm.c @@ -27,6 +27,7 @@ #include <sys/klog.h> #include <sys/types.h> #include <sys/stat.h> +#include <limits.h> #define CMD_ACTION_SIZE_BUFFER 10 #define CMD_ACTION_READ_ALL 3 @@ -51,7 +52,7 @@ static void get_exec_path(char *tpath, size_t size) static void get_asm_insns(uint8_t *image, size_t len, int opcodes) { int count, i, pc = 0; - char tpath[256]; + char tpath[PATH_MAX]; struct disassemble_info info; disassembler_ftype disassemble; bfd *bfdf; |