If yylex() fails, yyget_lineno() should not be called because it
accesses uninitialized memory:
==23686== Use of uninitialised value of size 4
==23686== at 0x46FA85D: _itoa_word (_itoa.c:178)
==23686== by 0x4704E14: __printf_buffer (vfprintf-process-arg.c:155)
==23686== by 0x471B91C: __vsprintf_internal (iovsprintf.c:62)
==23686== by 0x47010DD: sprintf (sprintf.c:30)
==23686== by 0x45A019F: lls_convert_config (config_file.l:272)
==23686== by 0x804F0BA: parse_options (misma.c:741)
==23686== by 0x804A879: main (misma.c:1529)
Just omit printing the line number for now.
if (errctx) {
*errctx = malloc(100);
if (*errctx)
- sprintf(*errctx, "error at line %d",
- yyget_lineno(yyscanner));
+ sprintf(*errctx, "yylex error");
}
}
yy_delete_buffer(yybs, yyscanner);