diff options
author | John Wiegley <johnw@newartisans.com> | 2010-01-18 03:41:20 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2010-01-18 03:41:20 -0500 |
commit | 67ce17e24959f55a4cd55857c7741d058397d758 (patch) | |
tree | c77cbf49617aea589cac7c4b0ca245f426793fd5 /src/item.cc | |
parent | b3a3ecccf2e8ddaab79b58fb68b134a39d29c395 (diff) | |
download | fork-ledger-67ce17e24959f55a4cd55857c7741d058397d758.tar.gz fork-ledger-67ce17e24959f55a4cd55857c7741d058397d758.tar.bz2 fork-ledger-67ce17e24959f55a4cd55857c7741d058397d758.zip |
Guard against using an uninitialized value
Fixes DDB54BB8-8C1C-4129-A137-07A38068F3BE
Diffstat (limited to 'src/item.cc')
-rw-r--r-- | src/item.cc | 5 |
1 files changed, 4 insertions, 1 deletions
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 _("<no item context>"); + return empty_string; assert(len > 0); assert(len < 2048); |