diff options
Diffstat (limited to 'contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp')
| -rw-r--r-- | contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp | 12 | 
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp index 9ace1583eb53..9e11d8d9ecbc 100644 --- a/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp +++ b/contrib/llvm-project/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp @@ -41,7 +41,7 @@ bool isRootChanged(intptr_t k) { return k == ROOT_CHANGED; }  //                      bug<--foo()--          JAIL_ENTERED<--foo()--  class ChrootChecker : public Checker<eval::Call, check::PreCall> {    // This bug refers to possibly break out of a chroot() jail. -  mutable std::unique_ptr<BuiltinBug> BT_BreakJail; +  mutable std::unique_ptr<BugType> BT_BreakJail;    const CallDescription Chroot{{"chroot"}, 1}, Chdir{{"chdir"}, 1}; @@ -125,11 +125,11 @@ void ChrootChecker::checkPreCall(const CallEvent &Call,      if (isRootChanged((intptr_t) *k))        if (ExplodedNode *N = C.generateNonFatalErrorNode()) {          if (!BT_BreakJail) -          BT_BreakJail.reset(new BuiltinBug( -              this, "Break out of jail", "No call of chdir(\"/\") immediately " -                                         "after chroot")); -        C.emitReport(std::make_unique<PathSensitiveBugReport>( -            *BT_BreakJail, BT_BreakJail->getDescription(), N)); +          BT_BreakJail.reset(new BugType(this, "Break out of jail")); +        constexpr llvm::StringLiteral Msg = +            "No call of chdir(\"/\") immediately after chroot"; +        C.emitReport( +            std::make_unique<PathSensitiveBugReport>(*BT_BreakJail, Msg, N));        }  }  | 
