aras-p / ClangBuildAnalyzer

Clang build analysis tool using -ftime-trace

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Need improve error handling

YarikTH opened this issue · comments

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.