summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2017-07-27 20:15:24 +0000
committerrobert <robert@openbsd.org>2017-07-27 20:15:24 +0000
commiteff98bee95ad266c7c1f0ed4ce0557012ee77c28 (patch)
tree099856578c340e7abc6deabf19c75b65b8f33b1e /gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp
parentpush back -pie to the linker if -pie is specified to avoid an unused argument (diff)
downloadwireguard-openbsd-eff98bee95ad266c7c1f0ed4ce0557012ee77c28.tar.xz
wireguard-openbsd-eff98bee95ad266c7c1f0ed4ce0557012ee77c28.zip
teach clang about our syslog format attribute
ok deraadt@
Diffstat (limited to 'gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp')
-rw-r--r--gnu/llvm/tools/clang/lib/Sema/SemaChecking.cpp5
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,