summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/item.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/item.cc b/src/item.cc
index cb69909f..44a80e63 100644
--- a/src/item.cc
+++ b/src/item.cc
@@ -339,6 +339,8 @@ string item_context(const item_t& item, const string& desc)
scoped_array<char> buf(new char[len + 1]);
in.read(buf.get(), len);
+ assert(static_cast<std::size_t>(in.gcount()) == len);
+ buf[len] = '\0';
std::ostringstream out;