summaryrefslogtreecommitdiff
path: root/tools/bpf/bpftool/jit_disasm.c
diff options
context:
space:
mode:
authorPrashant Bhole <bhole_prashant_q7@lab.ntt.co.jp>2017-11-02 17:09:45 +0900
committerDavid S. Miller <davem@davemloft.net>2017-11-02 20:25:27 +0900
commitcdc89c91987bd6efa962b36d4ea86d0c9152eb11 (patch)
treecfd5468c873c69a8d17cdad31e249638756a80cd /tools/bpf/bpftool/jit_disasm.c
parente20f469660ad526fcd9bf865e30ee491ae4e4a86 (diff)
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/bpftool/jit_disasm.c')
-rw-r--r--tools/bpf/bpftool/jit_disasm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/jit_disasm.c b/tools/bpf/bpftool/jit_disasm.c
index 5937e134e408..1551d3918d4c 100644
--- a/tools/bpf/bpftool/jit_disasm.c
+++ b/tools/bpf/bpftool/jit_disasm.c
@@ -21,6 +21,7 @@
#include <dis-asm.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <limits.h>
#include "json_writer.h"
#include "main.h"
@@ -80,7 +81,7 @@ void disasm_print_insn(unsigned char *image, ssize_t len, int opcodes)
disassembler_ftype disassemble;
struct disassemble_info info;
int count, i, pc = 0;
- char tpath[256];
+ char tpath[PATH_MAX];
bfd *bfdf;
if (!len)