When compiled by clang static analyzer, C files generated by flex give the following alarm in yy_init_buffer() :
Access to field 'yy_input_file' results in a dereference of a null pointer (loaded from variable 'b')
Fix: This may be a false positive and clang may not analyze the code deeply enough to discover it, but checking variable 'b' and exiting with a managed fatal error instead of a core dump if it is null would avoid the problem with no functional side-effects, and would be even more useful if there is indeed a code path that could end with a null buffer.
Patch attached with submission follows:
How-To-Repeat: Compile a file generated by flex with ccc-analyzer (from ports' clang ; it is not installed with the base system compiler).
For bugs matching the following criteria:
Status: In Progress Changed: (is less than) 2014-06-01
Reset to default assignee and clear in-progress tags.
Mail being skipped