aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScanfFormatString.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-07-20 20:04:47 +0000
committerTed Kremenek <kremenek@apple.com>2010-07-20 20:04:47 +0000
commit1e51c200b17cb6b0238c10a8760ae04765688f16 (patch)
tree1bea6f2a78b3483dc83a03e9082e79533a25ab32 /lib/Analysis/ScanfFormatString.cpp
parenta412a499162c46211c10ad92045b9b5fd2298ede (diff)
Hookup checking for invalid length modifiers in scanf format strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108907 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScanfFormatString.cpp')
-rw-r--r--lib/Analysis/ScanfFormatString.cpp44
1 files changed, 23 insertions, 21 deletions
diff --git a/lib/Analysis/ScanfFormatString.cpp b/lib/Analysis/ScanfFormatString.cpp
index 493a3c8df2..61af1d6737 100644
--- a/lib/Analysis/ScanfFormatString.cpp
+++ b/lib/Analysis/ScanfFormatString.cpp
@@ -19,6 +19,7 @@ using clang::analyze_format_string::ArgTypeResult;
using clang::analyze_format_string::FormatStringHandler;
using clang::analyze_format_string::LengthModifier;
using clang::analyze_format_string::OptionalAmount;
+using clang::analyze_format_string::ConversionSpecifier;
using clang::analyze_scanf::ScanfConversionSpecifier;
using clang::analyze_scanf::ScanfSpecifier;
@@ -146,27 +147,28 @@ static ScanfSpecifierResult ParseScanfSpecifier(FormatStringHandler &H,
switch (*conversionPosition) {
default:
break;
- case '%': k = ScanfConversionSpecifier::PercentArg; break;
- case 'A': k = ScanfConversionSpecifier::AArg; break;
- case 'E': k = ScanfConversionSpecifier::EArg; break;
- case 'F': k = ScanfConversionSpecifier::FArg; break;
- case 'G': k = ScanfConversionSpecifier::GArg; break;
- case 'X': k = ScanfConversionSpecifier::XArg; break;
- case 'a': k = ScanfConversionSpecifier::aArg; break;
- case 'd': k = ScanfConversionSpecifier::dArg; break;
- case 'e': k = ScanfConversionSpecifier::eArg; break;
- case 'f': k = ScanfConversionSpecifier::fArg; break;
- case 'g': k = ScanfConversionSpecifier::gArg; break;
- case 'i': k = ScanfConversionSpecifier::iArg; break;
- case 'n': k = ScanfConversionSpecifier::nArg; break;
- case 'c': k = ScanfConversionSpecifier::cArg; break;
- case 'C': k = ScanfConversionSpecifier::CArg; break;
- case 'S': k = ScanfConversionSpecifier::SArg; break;
- case '[': k = ScanfConversionSpecifier::ScanListArg; break;
- case 'u': k = ScanfConversionSpecifier::uArg; break;
- case 'x': k = ScanfConversionSpecifier::xArg; break;
- case 'o': k = ScanfConversionSpecifier::oArg; break;
- case 's': k = ScanfConversionSpecifier::sArg; break;
+ case '%': k = ConversionSpecifier::PercentArg; break;
+ case 'A': k = ConversionSpecifier::AArg; break;
+ case 'E': k = ConversionSpecifier::EArg; break;
+ case 'F': k = ConversionSpecifier::FArg; break;
+ case 'G': k = ConversionSpecifier::GArg; break;
+ case 'X': k = ConversionSpecifier::XArg; break;
+ case 'a': k = ConversionSpecifier::aArg; break;
+ case 'd': k = ConversionSpecifier::dArg; break;
+ case 'e': k = ConversionSpecifier::eArg; break;
+ case 'f': k = ConversionSpecifier::fArg; break;
+ case 'g': k = ConversionSpecifier::gArg; break;
+ case 'i': k = ConversionSpecifier::iArg; break;
+ case 'n': k = ConversionSpecifier::nArg; break;
+ case 'c': k = ConversionSpecifier::cArg; break;
+ case 'C': k = ConversionSpecifier::CArg; break;
+ case 'S': k = ConversionSpecifier::SArg; break;
+ case '[': k = ConversionSpecifier::ScanListArg; break;
+ case 'u': k = ConversionSpecifier::uArg; break;
+ case 'x': k = ConversionSpecifier::xArg; break;
+ case 'o': k = ConversionSpecifier::oArg; break;
+ case 's': k = ConversionSpecifier::sArg; break;
+ case 'p': k = ConversionSpecifier::pArg; break;
}
ScanfConversionSpecifier CS(conversionPosition, k);
if (k == ScanfConversionSpecifier::ScanListArg) {