* Fixed a minor buffer-overflow.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1083 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2008-11-16 14:51:27 +00:00
parent eb74609cdc
commit d05e889317
+1 -1
View File
@@ -60,7 +60,7 @@ system_method_generate_command(torrent::Object::list_const_iterator first, torre
template <int postfix_size>
inline const char*
create_new_key(const std::string& key, const char postfix[postfix_size]) {
char *buffer = new char[key.size() + postfix_size];
char *buffer = new char[key.size() + std::max(postfix_size, 1)];
std::memcpy(buffer, key.c_str(), key.size() + 1);
std::memcpy(buffer + key.size(), postfix, postfix_size);
return buffer;