hackers-painters/katana-parser

Crash due to void* dereference level mismatch in parser

mjrgh opened this issue · 0 comments

mjrgh commented

There are a few places in parser.c where void* pointers in the parser struct are used at the wrong indirection level. The C compiler doesn't catch these because of the opaque void* typing, but they cause crashes at run-time.

parser.c line 1254:    katanaget_text(parser->scanner)   // Should be *parser->scanner

parser.c line 1256:  YYSTYPE * s = katanaget_lval(parser->scanner);  // Should be *parser->scanner

parser.c line 1258: ...katana_get_previous_state(parser->scanner); // Should be *parser->scanner

parser.c line 1272:    katanaget_text(parser->scanner)   // Should be *parser->scanner