From e0578cc58a77223ba15f9582c026b84235f4843b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 12 Feb 2013 19:19:44 +0200 Subject: Don't use uninitialized iterator on the rhs of assignment --- common/session/custom/session.hxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/session/custom/session.hxx b/common/session/custom/session.hxx index cda0258..6de140e 100644 --- a/common/session/custom/session.hxx +++ b/common/session/custom/session.hxx @@ -104,6 +104,17 @@ public: cache_position (): map_ (0) {} cache_position (map& m, const iterator& p): map_ (&m), pos_ (p) {} + cache_position& + operator= (const cache_position& p) + { + // It might not be ok to use an uninitialized iterator on the rhs. + // + if (p.map_ != 0) + pos_ = p.pos_; + map_ = p.map_; + return *this; + } + map* map_; iterator pos_; }; -- cgit v1.1