Skip to content

Commit

Permalink
Fix nullpointer deref
Browse files Browse the repository at this point in the history
  • Loading branch information
ladisgin committed Sep 6, 2023
1 parent 6dca561 commit b7f51e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion server/src/KleeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,9 @@ static std::string getUTBotClangCompilerPath(fs::path clientCompilerPath) {
}
}

static const std::unordered_set<std::string> UNSUPPORTED_FLAGS_AND_OPTIONS_KLEE = {
static const std::unordered_set <std::string> UNSUPPORTED_FLAGS_AND_OPTIONS_KLEE = {
"--coverage",
"-lgcov",
"-fbranch-target-load-optimize",
"-fcx-fortran-rules",
"-fipa-cp-clone",
Expand Down
11 changes: 8 additions & 3 deletions server/src/fetchers/FunctionDeclsMatchCallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,13 @@ void FunctionDeclsMatchCallback::addFunctionPointer(
LOG_S(WARNING) << "Type '" << name << "' fetch as function pointer but can't get functionType";
}
} else if (type.isArrayOfPointersToFunction()) {
functionPointers[name] = ParamsHandler::getFunctionPointerDeclaration(
qualType->getPointeeType()->getPointeeType()->getAs<clang::FunctionType>(), name,
sourceManager, true);
const clang::FunctionType *functionType = qualType->getPointeeType()->getPointeeType()->getAs<clang::FunctionType>();
if (temp) {
functionPointers[name] = ParamsHandler::getFunctionPointerDeclaration(
temp, name,
sourceManager, true);
} else {
LOG_S(WARNING) << "Type '" << name << "' fetch as function pointer but can't get functionType";
}
}
}

0 comments on commit b7f51e1

Please sign in to comment.