Fix off-by-one allocation for reading remote strings

This commit is contained in:
David Farler
2016-03-07 10:35:04 -08:00
parent 96386b03be
commit db1a715ef1

View File

@@ -93,7 +93,7 @@ public:
return "";
auto NameBuffer = std::unique_ptr<uint8_t>(new uint8_t[NameSize + 1]);
if (!readBytes(Address, NameBuffer.get(), NameSize))
if (!readBytes(Address, NameBuffer.get(), NameSize + 1))
return "";
return std::string(reinterpret_cast<const char *>(NameBuffer.get()));
}