Fixes PR13476
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179228
91177308-0d34-0410-b5e6-
96231b3b80d8
// - strncat(dst, src, sizeof(dst) - 1);
// - strncat(dst, src, sizeof(dst));
bool WalkAST::containsBadStrncatPattern(const CallExpr *CE) {
+ if (CE->getNumArgs() != 3)
+ return false;
const Expr *DstArg = CE->getArg(0);
const Expr *SrcArg = CE->getArg(1);
const Expr *LenArg = CE->getArg(2);
X c = a + b;
}
+// Ensure we don't crash on custom-defined strncat.
+char strncat ();
+int main () {
+ return strncat ();
+}
\ No newline at end of file