Re: [PATCH] lib/message.cc: fix Coverity finding (use after free)

2017-03-18 Thread David Bremner
Tomi Ollila writes: > - const char *data; > > - data = message->doc.get_data ().c_str (); > + std::string datastr = message->doc.get_data (); > + const char *data = datastr.c_str (); > Pushed, d ___ notmuch

[PATCH] lib/message.cc: fix Coverity finding (use after free)

2017-03-17 Thread Tomi Ollila
The object where pointer to `data` was received was deleted before it was used in _notmuch_string_list_append(). Relevant Coverity messages follow: 3: extract Assigning: data = std::__cxx11::string(message->doc.()).c_str(), which extracts wrapped state from temporary of type