diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2012-03-30 18:03:33 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2012-04-02 12:14:55 +0200 |
commit | 2439c0dc90bcfd83d3e0eb4f08f19ef2face2118 (patch) | |
tree | 592ba41d257212ab839fa24422f57449e9570b70 /client | |
parent | 8cd92109d42db45fd5b3aa9674b2148550ffe17b (diff) |
Replace sprintf with snprintf use
The hotkey parser was generating a string with sprintf and data it got
from the controller socket (ie data which can have an arbitrary
length). Using sprintf there is a bad idea, replace it with snprintf.
Diffstat (limited to 'client')
-rw-r--r-- | client/hot_keys.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/client/hot_keys.cpp b/client/hot_keys.cpp index f98a4bb9..2d0b9db4 100644 --- a/client/hot_keys.cpp +++ b/client/hot_keys.cpp @@ -140,7 +140,7 @@ void HotKeysParser::add_hotkey(const std::string& hotkey, const CommandsMap& com if (commands_map.find(command_name) == commands_map.end()) { char buf[1000]; - sprintf(buf, "invalid action bname %s", command_name.c_str()); + snprintf(buf, sizeof(buf), "invalid action bname %s", command_name.c_str()); THROW(buf); } int command_id = commands_map.find(command_name)->second; |