notmuch/lib
David Bremner 4e649d000b lib: fix g_hash_table related read-after-free bug
The two g_hash_table functions (insert, add) have different behaviour
with respect to existing keys. g_hash_table_insert frees the new key,
while g_hash_table_add (which is really g_hash_table_replace in
disguise) frees the existing key. With this change 'ref' is live until
the end of the function (assuming single-threaded access to
'hash'). We can't guarantee it will continue to be live in the
future (i.e. there may be a future key duplication) so we copy it with
the allocation context passed to parse_references (in practice this is
the notmuch_message_t object whose parents we are finding).

Thanks to Tomi for the simpler approach to the problem based on
reading the fine glib manual.
2017-02-22 06:28:03 -04:00
..
built-with.c lib: add built_with handling for XAPIAN_DB_RETRY_LOCK 2016-06-29 09:05:49 +02:00
config.cc Use https instead of http where possible 2016-06-05 08:32:17 -03:00
database-private.h Use https instead of http where possible 2016-06-05 08:32:17 -03:00
database.cc lib: fix g_hash_table related read-after-free bug 2017-02-22 06:28:03 -04:00
directory.cc lib: update cached mtime in notmuch_directory_set_mtime 2016-08-23 20:58:46 -03:00
filenames.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
gen-version-script.sh Use https instead of http where possible 2016-06-05 08:32:17 -03:00
index.cc Use https instead of http where possible 2016-06-05 08:32:17 -03:00
libsha1.c util: detect byte order 2013-11-27 07:43:29 -04:00
libsha1.h fix sum moar typos [comments in source code] 2011-06-23 15:58:39 -07:00
Makefile fix sum moar typos [build scripts, Makefiles] 2011-06-23 15:44:59 -07:00
Makefile.local lib: basic message-property API 2016-09-21 18:14:24 -03:00
message-file.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
message-private.h lib: basic message-property API 2016-09-21 18:14:24 -03:00
message-property.cc lib: iterator API for message properties 2016-09-21 18:14:25 -03:00
message.cc lib: basic message-property API 2016-09-21 18:14:24 -03:00
messages.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
notmuch-private.h lib: extend private string map API with iterators 2016-09-21 18:14:24 -03:00
notmuch.h lib: document API added in 0.23 2016-10-06 22:46:01 -03:00
parse-time-vrp.cc Use https instead of http where possible 2016-06-05 08:32:17 -03:00
parse-time-vrp.h Use https instead of http where possible 2016-06-05 08:32:17 -03:00
query-fp.cc Use https instead of http where possible 2016-06-05 08:32:17 -03:00
query-fp.h Use https instead of http where possible 2016-06-05 08:32:17 -03:00
query.cc lib: provide _notmuch_database_log_append 2016-08-09 09:34:11 +09:00
sha1.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
string-list.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
string-map.c lib: add talloc reference from string map iterator to map 2016-09-24 10:08:45 -03:00
tags.c Use https instead of http where possible 2016-06-05 08:32:17 -03:00
thread.cc Use https instead of http where possible 2016-06-05 08:32:17 -03:00