diff options
author | Max Kellermann <max@duempel.org> | 2015-09-01 23:33:19 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-09-01 23:33:19 +0200 |
commit | e31cdf0df9604450f5b5a34ab43877f22479236c (patch) | |
tree | c5c50f9557f1683b5f0ad525c9347cfa66a0b27c /src/util | |
parent | 6f41791ea677edfa9614ef8624c465d16abf0ec5 (diff) | |
download | mpd-e31cdf0df9604450f5b5a34ab43877f22479236c.tar.gz mpd-e31cdf0df9604450f5b5a34ab43877f22479236c.tar.xz mpd-e31cdf0df9604450f5b5a34ab43877f22479236c.zip |
util/AllocatedString: fix off-by-one bug in Duplicate()
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/AllocatedString.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/AllocatedString.hxx b/src/util/AllocatedString.hxx index e01955381..01eefac8a 100644 --- a/src/util/AllocatedString.hxx +++ b/src/util/AllocatedString.hxx @@ -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); } |