Skip to content

Commit 2a1d2ed

Browse files
authored
Fix parameter nullpointer deref (#634)
1 parent 6dca561 commit 2a1d2ed

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

server/src/KleeGenerator.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ static std::string getUTBotClangCompilerPath(fs::path clientCompilerPath) {
9797
}
9898
}
9999

100-
static const std::unordered_set<std::string> UNSUPPORTED_FLAGS_AND_OPTIONS_KLEE = {
100+
static const std::unordered_set <std::string> UNSUPPORTED_FLAGS_AND_OPTIONS_KLEE = {
101101
"--coverage",
102+
"-lgcov",
102103
"-fbranch-target-load-optimize",
103104
"-fcx-fortran-rules",
104105
"-fipa-cp-clone",

server/src/fetchers/FunctionDeclsMatchCallback.cpp

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,13 @@ void FunctionDeclsMatchCallback::addFunctionPointer(
173173
LOG_S(WARNING) << "Type '" << name << "' fetch as function pointer but can't get functionType";
174174
}
175175
} else if (type.isArrayOfPointersToFunction()) {
176-
functionPointers[name] = ParamsHandler::getFunctionPointerDeclaration(
177-
qualType->getPointeeType()->getPointeeType()->getAs<clang::FunctionType>(), name,
178-
sourceManager, true);
176+
const clang::FunctionType *functionType = qualType->getPointeeType()->getPointeeType()->getAs<clang::FunctionType>();
177+
if (functionType) {
178+
functionPointers[name] = ParamsHandler::getFunctionPointerDeclaration(
179+
functionType, name,
180+
sourceManager, true);
181+
} else {
182+
LOG_S(WARNING) << "Type '" << name << "' fetch as function pointer but can't get functionType";
183+
}
179184
}
180185
}

0 commit comments

Comments
 (0)