aboutsummaryrefslogtreecommitdiffstats
path: root/clang-plugin
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-11 14:32:25 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-11-11 14:32:25 +0000
commit3d40543c86fe6debadaa10cc3a075a1e7896cccd (patch)
tree59a8e2ecd36e13fd98177332869d1d82ce58878a /clang-plugin
parent42b5ea575ad1e66878c9842f1f86b1820ed9a7df (diff)
downloadrspamd-3d40543c86fe6debadaa10cc3a075a1e7896cccd.tar.gz
rspamd-3d40543c86fe6debadaa10cc3a075a1e7896cccd.zip
Fix issues in reading format strings
Diffstat (limited to 'clang-plugin')
-rw-r--r--clang-plugin/printf_check.cc10
1 files changed, 8 insertions, 2 deletions
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<std::string, int> printf_functions;
+ std::unordered_map<std::string, unsigned int> printf_functions;
ASTContext *pcontext;
std::unique_ptr<PrintfArgChecker> 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);