From: Vsevolod Stakhov Date: Wed, 11 Nov 2015 14:32:25 +0000 (+0000) Subject: Fix issues in reading format strings X-Git-Tag: 1.1.0~591 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3d40543c86fe6debadaa10cc3a075a1e7896cccd;p=rspamd.git Fix issues in reading format strings --- diff --git a/clang-plugin/printf_check.cc b/clang-plugin/printf_check.cc index 5ebbeef1f..37e8dc399 100644 --- a/clang-plugin/printf_check.cc +++ b/clang-plugin/printf_check.cc @@ -87,7 +87,7 @@ namespace rspamd { }; class PrintfCheckVisitor::impl { - std::unordered_map printf_functions; + std::unordered_map printf_functions; ASTContext *pcontext; std::unique_ptr parseFlags (const std::string &flags) @@ -215,7 +215,13 @@ namespace rspamd { llvm::errs () << "invalid modifier\n"; return nullptr; } - state = ignore_chars; + + if (c == '%') { + state = read_percent; + } + else { + state = ignore_chars; + } } else { flags.push_back (c);