Commit e31cdf0d authored by Max Kellermann's avatar Max Kellermann

util/AllocatedString: fix off-by-one bug in Duplicate()

parent 6f41791e
......@@ -90,7 +90,7 @@ public:
static AllocatedString Duplicate(const_pointer begin,
size_t length) {
auto p = new value_type[length];
auto p = new value_type[length + 1];
*std::copy_n(begin, length, p) = SENTINEL;
return Donate(p);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment