diff options
| author | Matt Beaumont-Gay <matthewbg@google.com> | 2012-07-30 20:21:58 +0000 |
|---|---|---|
| committer | Matt Beaumont-Gay <matthewbg@google.com> | 2012-07-30 20:21:58 +0000 |
| commit | 5c8de784f678a1b926fe055b78a5db9502d11809 (patch) | |
| tree | 6fe9ed7913dcbd3e241943b3d6aab03eef4d2245 /clang/lib | |
| parent | d457ca92cee8f4d953c07d9e6fbafadb7f2387ab (diff) | |
| download | bcm5719-llvm-5c8de784f678a1b926fe055b78a5db9502d11809.tar.gz bcm5719-llvm-5c8de784f678a1b926fe055b78a5db9502d11809.zip | |
Do not warn on correct use of the '%n' format specifier.
While '%n' can be used for evil in an attacker-controlled format string, there
isn't any acute danger in using it in a literal format string with an argument
of the appropriate type.
llvm-svn: 160984
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 200b9439a66..dce912c4771 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -2561,15 +2561,6 @@ CheckPrintfHandler::HandlePrintfSpecifier(const analyze_printf::PrintfSpecifier HandleNonStandardConversionSpecification(LM, CS, startSpecifier, specifierLen); - // Are we using '%n'? - if (CS.getKind() == ConversionSpecifier::nArg) { - // Issue a warning about this being a possible security issue. - EmitFormatDiagnostic(S.PDiag(diag::warn_printf_write_back), - getLocationOfByte(CS.getStart()), - /*IsStringLocation*/true, - getSpecifierRange(startSpecifier, specifierLen)); - } - // The remaining checks depend on the data arguments. if (HasVAListArg) return true; |

