mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2025-12-26 22:48:19 +00:00
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.
This commit is contained in:
parent
8cd92109d4
commit
2439c0dc90
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user