From 67ce17e24959f55a4cd55857c7741d058397d758 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 18 Jan 2010 03:41:20 -0500 Subject: Guard against using an uninitialized value Fixes DDB54BB8-8C1C-4129-A137-07A38068F3BE --- src/item.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/item.cc') diff --git a/src/item.cc b/src/item.cc index 99d1d835..f86b8ec8 100644 --- a/src/item.cc +++ b/src/item.cc @@ -437,9 +437,12 @@ void print_item(std::ostream& out, const item_t& item, const string& prefix) string item_context(const item_t& item, const string& desc) { + if (! item.pos) + return empty_string; + std::streamoff len = item.pos->end_pos - item.pos->beg_pos; if (! len) - return _(""); + return empty_string; assert(len > 0); assert(len < 2048); -- cgit v1.2.3