This commit is contained in:
arvidn 2016-06-28 08:43:31 -04:00
parent b1e36a53e3
commit 55d8b0625f
1 changed files with 4 additions and 1 deletions

View File

@ -77,7 +77,10 @@ namespace libtorrent { namespace aux
#pragma clang diagnostic pop
#endif
m_storage.resize(len > 512 ? 512 : len);
if (len < 0) return copy_string("(format error)");
// +1 is to include the 0-terminator
m_storage.resize(ret + (len > 512 ? 512 : len) + 1);
return ret;
}