VI4IO / io500-app

Development version of the new IO-500 Application
MIT License
18 stars 11 forks source link

io500: avoid segfault when parsing bad .ini input #14

Closed adilger closed 4 years ago

adilger commented 4 years ago

If there is an invalid line of text at the start of the .ini file before the first [global] section has been parsed in u_parse_ini(), then the "section" pointer is still NULL and trying to print it in the error message results in a segfault. Avoid the NULL section.

Running "./io500 --list > config-new.ini" would result in the line "Supported and current values of the ini file:" being included at the start of the .ini file, which triggered this segfault. Print this line as a comment so that this works as one would expect.

Signed-off-by: Andreas Dilger adilger@dilger.ca