We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 06fd409 commit 900ae45Copy full SHA for 900ae45
1 file changed
lib/PhasarLLVM/DataFlow/IfdsIde/Problems/IFDSTaintAnalysis.cpp
@@ -281,7 +281,17 @@ IFDSTaintAnalysis::FlowFunctionPtrType
281
IFDSTaintAnalysis::getSummaryFlowFunction(
282
[[maybe_unused]] IFDSTaintAnalysis::n_t CallSite,
283
[[maybe_unused]] IFDSTaintAnalysis::f_t DestFun) {
284
- // Don't use a special summary
+ // $sSS1poiyS2S_SStFZ is Swift's String append method
285
+ // if concat a tainted string with something else the
286
+ // result should be tainted
287
+ if (DestFun->getName().equals("$sSS1poiyS2S_SStFZ")) {
288
+ const auto *CS = llvm::cast<llvm::CallBase>(CallSite);
289
+
290
+ return generateFlowIf<d_t>(CallSite, [CS](d_t Source) {
291
+ return ((Source == CS->getArgOperand(1)) ||
292
+ (Source == CS->getArgOperand(3)));
293
+ });
294
+ }
295
return nullptr;
296
}
297
0 commit comments