mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Fix off-by-one allocation for reading remote strings
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user