aras-p / ClangBuildAnalyzer

Clang build analysis tool using -ftime-trace
The Unlicense
969 stars 60 forks source link

Need improve error handling #60

Open YarikTH opened 3 years ago

YarikTH commented 3 years ago

I mistakenly passed my artefacts folder path to the "--analize" arg and ClangBuildAnalyzer crashed with std::bad_alloc from BufferedReader(FILE* f) when "fsize" was calculated as 9223372036854775807. I think it's better to add some additional checks for stupid errors like this. At least need to check that path is valid and it points to a file. Also, errors handling when working with fseek, ftello64 etc is completely skipped and ftello64 even returns signed int64_t and it also wasn't checked before being implicitly cast to size_t.