Skip to content

Commit d920f7c

Browse files
author
Michal Marek
committed
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 <bp@alien8.de> Signed-off-by: Michal Marek <mmarek@suse.com>
1 parent 7ce7d89 commit d920f7c

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

‎scripts/genksyms/parse.y‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,6 @@ direct_declarator:
322322
{ $$ = $2; }
323323
| '(' declarator ')'
324324
{ $$ = $3; }
325-
| '(' error ')'
326-
{ $$ = $3; }
327325
;
328326

329327
/* Nested declarators differ from regular declarators in that they do

0 commit comments

Comments
 (0)