From d920f7c6628c63a390009c237fb80a203c2e400a Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Tue, 3 Jan 2017 14:40:44 +0100 Subject: genksyms: Fix segfault with invalid declarations Do not try to recover too early and segfault when parsing invalid declarations such as echo 'int (int);' | scripts/genksyms/genksyms echo 'int a, (int);' | scripts/genksyms/genksyms echo 'extern void *__inline_memcpy((void *), (const void *), (__kernel_size_t));' | scripts/genksyms/genksyms The last one was a real-life bug with include/asm-generic/asm-prototypes.h on x86_64. Reported-and-tested-by: Borislav Petkov Signed-off-by: Michal Marek --- scripts/genksyms/parse.y | 2 -- 1 file changed, 2 deletions(-) (limited to 'scripts/genksyms') diff --git a/scripts/genksyms/parse.y b/scripts/genksyms/parse.y index 4fba255e54ae..00a6d7e54971 100644 --- a/scripts/genksyms/parse.y +++ b/scripts/genksyms/parse.y @@ -322,8 +322,6 @@ direct_declarator: { $$ = $2; } | '(' declarator ')' { $$ = $3; } - | '(' error ')' - { $$ = $3; } ; /* Nested declarators differ from regular declarators in that they do -- cgit