| 968 | } |
| 969 | |
| 970 | const Check::FileInfo * CheckBufferOverrun::loadFileInfoFromXml(const tinyxml2::XMLElement *xmlElement, const std::string& file0) const |
| 971 | { |
| 972 | const std::string arrayIndex("array-index"); |
| 973 | const std::string pointerArith("pointer-arith"); |
| 974 | |
| 975 | auto *fileInfo = new MyFileInfo(file0); |
| 976 | for (const tinyxml2::XMLElement *e = xmlElement->FirstChildElement(); e; e = e->NextSiblingElement()) { |
| 977 | const char* name = e->Name(); |
| 978 | if (name == arrayIndex) |
| 979 | fileInfo->unsafeArrayIndex = CTU::loadUnsafeUsageListFromXml(e); |
| 980 | else if (name == pointerArith) |
| 981 | fileInfo->unsafePointerArith = CTU::loadUnsafeUsageListFromXml(e); |
| 982 | } |
| 983 | |
| 984 | if (fileInfo->unsafeArrayIndex.empty() && fileInfo->unsafePointerArith.empty()) { |
| 985 | delete fileInfo; |
| 986 | return nullptr; |
| 987 | } |
| 988 | |
| 989 | return fileInfo; |
| 990 | } |
| 991 | |
| 992 | /** @brief Analyse all file infos for all TU */ |
| 993 | bool CheckBufferOverrun::analyseWholeProgram(const CTU::FileInfo &ctu, const std::list<const Check::FileInfo*> &fileInfo, const Settings& settings, ErrorLogger &errorLogger) |
nothing calls this directly
no test coverage detected