diff options
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp')
| -rw-r--r-- | gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp b/gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp index 3aedb2a8c9b..800193795e2 100644 --- a/gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp +++ b/gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp @@ -4714,7 +4714,7 @@ checkFormatStringExpr(Sema &S, const Expr *E, ArrayRef<const Expr *> Args, Sema::FormatStringType Sema::GetFormatStringType(const FormatAttr *Format) { return llvm::StringSwitch<FormatStringType>(Format->getType()->getName()) .Case("scanf", FST_Scanf) - .Cases("printf", "printf0", FST_Printf) + .Cases("printf", "printf0", "syslog", FST_Printf) .Cases("NSString", "CFString", FST_NSString) .Case("strftime", FST_Strftime) .Case("strfmon", FST_Strfmon) @@ -4811,6 +4811,7 @@ bool Sema::CheckFormatArguments(ArrayRef<const Expr *> Args, case FST_Kprintf: case FST_FreeBSDKPrintf: case FST_Printf: + case FST_Syslog: Diag(FormatLoc, diag::note_format_security_fixit) << FixItHint::CreateInsertion(FormatLoc, "\"%s\", "); break; @@ -6352,7 +6353,7 @@ static void CheckFormatString(Sema &S, const FormatStringLiteral *FExpr, if (Type == Sema::FST_Printf || Type == Sema::FST_NSString || Type == Sema::FST_FreeBSDKPrintf || Type == Sema::FST_OSLog || - Type == Sema::FST_OSTrace) { + Type == Sema::FST_OSTrace || Type == Sema::FST_Syslog) { CheckPrintfHandler H( S, FExpr, OrigFormatExpr, Type, firstDataArg, numDataArgs, (Type == Sema::FST_NSString || Type == Sema::FST_OSTrace), Str, |
