diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2018-06-03 00:06:38 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2018-06-03 17:46:55 +0300 |
commit | b3bbba3570a7ba064f12c33f484eb9757a2b359e (patch) | |
tree | 68e5b635828abb20800a5f268cbbf01ecc8d0639 /tools | |
parent | 1fbc2e0cfcf9677683aea2b1f9ea76fbdc6fb6d1 (diff) | |
download | linux-b3bbba3570a7ba064f12c33f484eb9757a2b359e.tar.xz |
bpf: fix cbpf parser bug for octal numbers
Range is 0-7, not 0-9, otherwise parser silently excludes it from the
strtol() rather than throwing an error.
Reported-by: Marc Boschma <marc@boschma.cx>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bpf/bpf_exp.l | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/bpf/bpf_exp.l b/tools/bpf/bpf_exp.l index bd83149e7be0..4da8d053d68f 100644 --- a/tools/bpf/bpf_exp.l +++ b/tools/bpf/bpf_exp.l @@ -175,7 +175,7 @@ extern void yyerror(const char *str); yylval.number = strtol(yytext, NULL, 10); return number; } -([0][0-9]+) { +([0][0-7]+) { yylval.number = strtol(yytext + 1, NULL, 8); return number; } |