mu/lib
attila a0640a0532 Fix call to c_str() that sometimes dumps core on OpenBSD i386-current
The core dump only seems to occur if mu4e-headers-include-related is
set to t.

Apparently, std::string's c_str() method is confusing to many
people, c.f.
  http://stackoverflow.com/questions/22330250/how-to-return-a-stdstring-c-str

The answer seems to be that the pointer c_str() returns may not be
valid past the current statement; returning it, or even using it
subsequently can have you sending a wild pointer into e.g. g_strdup().

In short, it seems idioms like this are okay:

    return g_strcmp0 (s1.c_str(), s2.c_str()) < 0;

Whereas idioms like this are not:

    const char *msgid (iter->msgid().c_str());

    return msgid ? g_strdup (msgid) : NULL;

At least in my environment by the time we get to g_strdup() the
pointer returned by c_str() is wild and points at garbage.  Since
g_strdup() returns NULL if passed NULL, it seems collapsing it into a
single line is not only possible but necessary.

I've looked at all of the calls to c_str() in mu and it appears to
me this was the one remaining one that was bad.
2015-07-02 15:14:29 -05:00
..
tests mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
Makefile.am * cleanup: drop gmime-2.4 support 2013-07-21 14:44:44 +03:00
doxyfile.in * lib: doxygen support (WIP, just starting...) 2012-10-27 14:42:21 +03:00
mu-bookmarks.c * update copyright years 2013-03-30 11:32:07 +02:00
mu-bookmarks.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-contacts.c * mu-contacts, mu-msg-file: better deal with contacts with control chars 2013-06-24 22:42:18 +03:00
mu-contacts.h * mu: add the backend for freq information for contacts 2013-06-16 23:02:19 +03:00
mu-container.c mu: Make mu_container_splice_grandchildren() do only one thing 2014-08-15 10:11:21 +02:00
mu-container.h mu: Make mu_container_splice_grandchildren() do only one thing 2014-08-15 10:11:21 +02:00
mu-date.c date-parsing: don't lowercase date range strings 2015-03-22 10:24:14 +02:00
mu-date.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-flags.c * mu: unbreak unit test after flag changes (fixes #247) 2013-07-07 10:46:35 +03:00
mu-flags.h * mu: unbreak unit test after flag changes (fixes #247) 2013-07-07 10:46:35 +03:00
mu-index.c mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-index.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-log.c mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-log.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-maildir.c mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-maildir.h * cosmetics 2013-06-24 22:44:36 +03:00
mu-msg-crypto.c fix for #587 2015-02-20 14:50:11 +01:00
mu-msg-doc.cc * update copyright years 2013-03-30 11:32:07 +02:00
mu-msg-doc.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-msg-fields.c * mu-msg-fields.[ch]: cleanup a bit 2013-05-13 00:03:06 +03:00
mu-msg-fields.h * mu-msg-fields.[ch]: cleanup a bit 2013-05-13 00:03:06 +03:00
mu-msg-file.c mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-msg-file.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-msg-iter.cc Fix call to c_str() that sometimes dumps core on OpenBSD i386-current 2015-07-02 15:14:29 -05:00
mu-msg-iter.h Fix a core dump under OpenBSD 2015-03-06 00:12:34 +02:00
mu-msg-part.c Fix core dump in mu-server (at least) for cmd:extract index:0 ... 2015-06-30 16:28:26 -05:00
mu-msg-part.h Fix #280 2015-02-16 01:19:32 +02:00
mu-msg-prio.c * update copyright years 2013-03-30 11:32:07 +02:00
mu-msg-prio.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-msg-priv.h Fix #280 2015-02-16 01:19:32 +02:00
mu-msg-sexp.c Add Decryption field 2014-10-19 03:27:58 +03:00
mu-msg.c mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-msg.h * cleanup: drop gmime-2.4 support 2013-07-21 14:44:44 +03:00
mu-query.cc Fix a core dump under OpenBSD 2015-03-06 00:12:34 +02:00
mu-query.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-runtime.c * fix a few compiler warnings 2013-05-13 22:30:27 +03:00
mu-runtime.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-script.c * update copyright years 2013-03-30 11:32:07 +02:00
mu-script.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-store-priv.hh mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-store-read.cc Rework getting database version (#469) 2014-09-23 07:32:39 +03:00
mu-store-write.cc * mu: store date as 0 if it does not exist; this allows searching 2014-03-22 18:51:39 +02:00
mu-store.cc mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-store.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-str.c mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-str.h * handle message-ids a bit specially, update unit tests 2013-10-13 20:05:29 +03:00
mu-threader.c threader: try to handle pathless messages 2014-10-13 09:56:39 +03:00
mu-threader.h * update copyright years 2013-03-30 11:32:07 +02:00
mu-util.c mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00
mu-util.h mu: don't use __FUNCTION__, use __func__ 2015-04-22 21:06:31 +03:00